[racket] local-expand subexpressions

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Oct 10 19:35:40 EDT 2012

When the stop list is non-empty, then identifiers for all of the core
forms are automatically added (because it generally doesn't work to
stop at some identifiers and not the core forms). So, that's why
expansion stops at `let-values'.

At Wed, 10 Oct 2012 17:31:13 -0600, Jon Rafkind wrote:
> My understanding of local-expand from the documentation is that when the 
> stop-list is not #f that sub-expressions will be expanded but I can't seem to 
> get this to happen.
> 
> #lang racket
> 
> (define-syntax-rule (bar x) (+ x 1))
> (define-syntax (foo stx)
>   (syntax-case stx ()
>     [(_ expr)
>      (printf "~a\n" (syntax->datum (local-expand #'expr 'expression (list 
> #'+))))
>      #'1]))
> 
> 
> (foo (let () (bar 8)))
> (foo (bar 8))
> 
> --
> Prints
> 
> (let-values () (bar 8))
> (+ 8 1)
> 
> Shouldn't the (bar 8) in the let-values be expanded?
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.