On Sat, Nov 7, 2009 at 8:34 PM, Stefan Arentz <ste...@arentz.ca> wrote:
> On 2009-11-07, at 8:28 PM, John Harrop wrote: > > > On Sat, Nov 7, 2009 at 8:04 PM, Stefan Arentz <ste...@arentz.ca> > > wrote: > > But I'm using this in a bigger macro that takes a bunch of functions > > as a parameter. Is there a way to make this work or should I > > 'translate' the functions that I take by name with (var foo)? > > > > You'll need to translate the symbols into vars using resolve, I think. > > Hmmm > > user=> (var foo) > #'user/foo > > user=> (meta (var foo)) > {:ns #<Namespace user>, :name foo, :file "NO_SOURCE_FILE", :line > 1, :arglists ([]), :xxx 1} > > user=> ((var foo)) > "foo" > > I'll give this a try in my macro later today :-) Eh. `(var ~argument) should work. You'll need resolve if you ever want to do this in a function though, or use the var object in the macro body itself (as opposed to only using the var object in the code that results from the macro's expansion). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---