Maybe this help to see what I'm after,

#'(let ((x v)) #.(f #'x))

<=>

(let-syntax ((g (lambda (stx) (syntax-case  stx ((_ x) (f #'x)))))
   #'(let ((x v)) (g x))


Now I would like to have a corresponding #.@ notation as well but can't
find an analog
for that :-(

/Stefan

On Mon, Jul 2, 2012 at 9:28 PM, Ludovic Courtès <l...@gnu.org> wrote:

> Hi Stefan,
>
> Stefan Israelsson Tampe <stefan.ita...@gmail.com> skribis:
>
> > Hygiene is harder to maintain. e.g.  I kept on hitting this kind of code
> > snippets
> >
> > #'(let ((x v))
> >     #,(f rest #'x))
> >
> > The problem with this code is hygiene, I need to make a gensym and use
> > with-syntax to bound x to that gensym in order to be safe
> > at the macro expansion.
>
> What do you mean?  Here ‘x’ leads to a newly introduced binding.
>
> Likewise, the code below doesn’t introduce bindings non-hygienic
> bindings, and is non-ambiguous:
>
>   (macroexpand '(let-syntax ((f (lambda (s)
>                                   (syntax-case s ()
>                                     ((_ x y)
>                                      #`(let ((p x))
>                                          (+ p #,(identity #'y))))))))
>                   (f 1 2)))
>
>   => #<tree-il (let (p) (p-28239) ((const 1)) (apply (toplevel +) (lexical
> p p-28239) (const 2)))>
>
> Thanks,
> Ludo’.
>
>
>

Reply via email to