You don't need to use eval to create a function dynamically in a macro.

For an example, take a look at:
https://github.com/duck1123/ciste/blob/master/src/main/clojure/ciste/sections.clj#L34

On Thu, Jun 2, 2011 at 10:34 PM, Ken Wesson <kwess...@gmail.com> wrote:
> On Thu, Jun 2, 2011 at 10:06 PM, nil <ache...@gmail.com> wrote:
>> Hi
>>
>> Here's another macro-noob question. (Thanks for the help on the
>> previous question and please do let me know if stackoverflow is a more
>> appropriate place to ask noob questions.)
>>
>> I'm trying to write a macro (or a function) that defines/declares
>> specifically named functions. In (let [eff "gee"] (foo eff)) I want
>> the macro foo to define/declare a function called foo-gee, not foo-
>> eff. What should I do differently?
>
> The problem here is that macros run at compile time, but let bindings
> exist at run time.
>
> If you need the name to be determined at run time you will need to use eval.
>
> If you don't need the name at run time, why are you using (let [eff
> "gee"] (foo eff)) and not simply (foo gee)?
>
> Please state your requirements clearly.
> --
> Protege: What is this seething mass of parentheses?!
> Master: Your father's Lisp REPL. This is the language of a true
> hacker. Not as clumsy or random as C++; a language for a more
> civilized age.
>
> --
> 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

-- 
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

Reply via email to