On Mon, Jun 27, 2011 at 2:13 AM, Stephen C. Gilardi <squee...@mac.com> wrote:
> As Rich noted
> here: http://groups.google.com/group/clojure/msg/513367afb934d41b , when the
> var names a function and it's used in an expression emitted from a
> macro, prefer invoking the var:
> (#'some-ns/some-private-var some args)
> over invoking the function to which it is currently bound:
> (@#'some-ns/some-private-var some args)

I'm not sure of Rich's rationale for this. With

`(do-some-stuff
   (~@#'some-ns/some-private-fn some ~@args))

you'd have the problem of embedding the function object in the code,
but not with

`(do-some-stuff
   (@#'some-ns/some-private-fn some ~@args))

which will just emit

(do-some-stuff
  ((deref (var (some-ns/some-private-fn))) some arg1 arg2 arg3))

or the like. As for moving the cost of the deref to macroexpansion
time, I don't think that can be done without embedding the function
object, for obvious reasons.

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

Reply via email to