[plt-dev] Symptom of REPL's hopelessness?

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Thu Oct 1 16:40:24 EDT 2009

At Thu, 1 Oct 2009 16:23:03 -0400, Ryan Culpepper wrote:
> To back up my analysis, here's a variation of the macro. Because of  
> begin-splicing etc etc, the definition is *executed* before the 'set!'  
> expression is *compiled*. And it works. (Or so it seems.)
> 
> (define-syntax (m stx)
>    (syntax-case stx ()
>      [(_ x)
>       (with-syntax ([(y) (generate-temporaries (syntax (x)))])
>         (syntax (begin (define (y) #f)
>                        (set! y (lambda () y)))))]))

Right. This variant does the same thing as the `define-syntaxes' hack
--- but it actually defines the identifier to make it exist, which
works just as well in this case.



Posted on the dev mailing list.