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

From: Richard Cleis (rcleis at mac.com)
Date: Mon Feb 15 02:04:04 EST 2010

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:



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

Posted on the users mailing list.