[plt-scheme] Re: An Introduction to PLT Scheme with Pictures - macros

From: ih (irvin.hwang at gmail.com)
Date: Mon Feb 15 09:30:11 EST 2010

Thanks.  I was looking at the example in the pict+code macro in the
tutorial, but I did not realize the name of the macro had to be at the
beginning of an expression.  I'll take a look at the link you sent.


On Feb 15, 2:04 am, Richard Cleis <rcl... at mac.com> wrote:
> What macro example are you following?
>
> It doesn't work because the macro doesn't allow moving it's name from the beginning of an expression.
>
> See the Planet implementation of infix:
>
> http://planet.plt-scheme.org/package-source/dyoo/infix.plt/1/1/doc.txt
>
> rac
>
> On Feb 14, 2010, at 11:36 AM, ih wrote:
>
>
>
> > Hi,
> > I'm relatively new to scheme and had a question about macros while
> > going through the tutorial "An Introduction to PLT Scheme with
> > Pictures".
>
> > I tried to follow the macro example and create infix addition e.g. (3
> > in-add 4) evaluates to 7
>
> > (define-syntax in-add
> > (syntax-rules ()
> >   [(a in-add b)
> >    (+ a b)]))
>
> > This did not work so my main question is how would one do this (if
> > possible)?  Thanks.
> > _________________________________________________
> > For list-related administrative tasks:
> >http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> _________________________________________________
>   For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-scheme


Posted on the users mailing list.