I think you probably also want an example with a namespace anchor and
without a module:

#lang scheme

(define-namespace-anchor anchor)
(parameterize ([current-namespace (namespace-anchor->namespace anchor)])
  (expand
   (datum->syntax
    #f
    '(delay (+ 1 2)))))




On Tue, Nov 17, 2009 at 1:05 PM, John Clements
<cleme...@brinckerhoff.org> wrote:
>
> On Nov 15, 2009, at 3:40 PM, Robby Findler wrote:
>
>> I've seen that Jon Rafkind has been adding such things to lots of
>> places in the docs and I've put them in the new image documentation
>> library (http://pre.plt-scheme.org/docs/html/teachpack/2htdpimage.html),
>> so I think it is safe to say we recognize the need and are working on
>> it.
>
> Every time I want to use 'expand' I have to spend 10 minutes trying to 
> remember all of the pieces.  This appears to me to be about the shortest way 
> to use 'expand' correctly:
>
> (parameterize ([current-namespace (make-base-namespace)])
>  (expand
>   (datum->syntax
>    #f
>    '(module foo scheme
>       (define a 3)
>       (+ a 4)))))
>
>
> Would it be appropriate to add this (or a simpler form, if it exists) to the 
> 'expand' documentation? It would certainly have helped me.
>
> John
>
>
> _________________________________________________
>  For list-related administrative tasks:
>  http://list.cs.brown.edu/mailman/listinfo/plt-dev
>
>
_________________________________________________
  For list-related administrative tasks:
  http://list.cs.brown.edu/mailman/listinfo/plt-dev

Reply via email to