Re: #!quote

Turadg Aleahmad <[email protected]>
Newsgroups gmane.comp.java.sisc.devel
Message-ID <[email protected]>
Matthias Radestock wrote:

> Scott may know a way of fixing your problem. However, it occurred to 
> me that what you'd really want is to redefine DEFINE so that you can 
> get hold of the *original* (pre macro expansion) body.


Yes! That's exactly what I want.

I don't think I understand how to use this snippet:

> (let-syntax ([old-define (syntax-rules ()
>                            [(_ . rest) (define . rest)])])
>   (define-syntax define
>     (syntax-rules (lambda)
>       [(_ name (lambda formals . body))
>        (old-define name (let ([p (lambda formals . body)])
>                           (set-procedure-property! p 'definition
>                                                    '(lambda formals . 
> body))
>                           p))]
>       [(_ (name . formals) . body)
>        (define name (lambda formals . body))]
>       [(_ . rest) (old-define . rest)])))


The parens are balanced in the above.

>     (define (foo x) x)))


But then you give this line which has an extra two close-parens.  Where 
is is supposed to fit?  If I make it the end of hte let-syntax 
expression, after hitting enter the REPL freezes on me.  (And if I make 
it the end of syntax-rules, as suggested by the two dangling close 
parens, it's invalid syntax.)

-Turadg



-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.