Hi, 2009/6/26 Michele Simionato <michele.simion...@gmail.com>
> > > On Jun 26, 3:51 pm, Rich Hickey <richhic...@gmail.com> wrote: > > By using quote, and not syntax-quote, you have written an > > intentionally capturing macro > > Acc, I missed that. I have read the documentation of syntax-quote now: > > "" > For Symbols, syntax-quote resolves the symbol in the current context, > yielding a fully-qualified symbol (i.e. namespace/name or > fully.qualified.Classname). If a symbol is non-namespace-qualified and > ends with '#', it is resolved to a generated symbol with the same name > to which '_' and a unique id have been appended. e.g. x# will resolve > to x_123. All references to that symbol within a syntax-quoted > expression resolve to the same generated symbol. > "" > > That means that I do not need gensym, I can just add a `#` to the > identifiers I want to introduce hygienically, right? > I guess this is what you meant by autogensym in the other post. A > pretty cool idea, actually. The unique gotcha I'm aware of with the '#' autogensym is that it is transformed at read time, so be aware of not using it in some loop assuming that you will have a new identifier each time, or do not use it to generate an identifier that would be defined (by using a variant of def -> defn, defstruct, defmacro ..) by the macro (if you do so, then each new macro invocation would continuously override a unique definition, rather than creating new ones with unique names). Regards, -- Laurent --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---