[plt-scheme] Re: Macro changing behaviour

From: Paulo J. Matos (pocmatos at gmail.com)
Date: Tue Apr 21 18:38:31 EDT 2009

On Tue, Apr 21, 2009 at 10:30 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> Hi all,
>
> I have a simple issue:
> (define-syntax-rule (test proc . args)
>  (apply proc args))
> (test (lambda () (+ 1 1)))
>
> doesn't work. Generates:
>  #%app: missing procedure expression; probably originally (), which is
> an illegal empty application in: (#%app)
>
> But this works:
> (apply (lambda () (+ 1 1)) '())
>
> So, somewhere this goes wrong. Can someone explain me what's the issue?
>

Whoops, my bad, can't use rest args there, need to use syntax-rules. :)

> Cheers,
> --
> Paulo Jorge Matos - pocmatos at gmail.com
> Webpage: http://www.personal.soton.ac.uk/pocm
>



-- 
Paulo Jorge Matos - pocmatos at gmail.com
Webpage: http://www.personal.soton.ac.uk/pocm


Posted on the users mailing list.