2009/7/17 Mark Addleman <mark_addle...@bigfoot.com>

>
> "The "sufficiently smart compiler" argument
>  comes to mind: if the arglist of a function is known, then surely
> the
>  compiler should be able to automatically translate named/keyword
>  arguments into an appropriate simple call?"
>
> That is exactly what motivated me to write this macro.  I was pretty
> sure keyword args could be optimized to exactly the same as positional
> arguments without much difficulty (although this macro took me an
> embarrassingly long time to write!).  I wish there was a way to hook
> the reader so that the macro could be called implicitly.  It seems
> that the metadata facility would be a perfect solution to this.  If I
> tag some symbol with metadata {:interpreter named-call}, for example,
> the reader should delegate to the macro named-call.


Not so easy I think, even if you had that.

How would the hooked-under-the-hoods named-call macro distinguish between
this call (some-fn :a :b :c :d) (regular call of some-fn body defined for
arity = 4) from (some-fn :a :b :c :d) (regular call of some-fn body with
named arguments, for arity = 2) if some-fn is defined for arities 2 and 4 ?

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