you can use apply to avoid in-lining: user=> (binding [+ -] (apply + '(5 3))) 2
On Tue, Jun 16, 2009 at 11:16 AM, Michel S.<michel.syl...@gmail.com> wrote: > > > > On Jun 16, 1:42 pm, Paul Stadig <p...@stadig.name> wrote: >> On Tue, Jun 16, 2009 at 1:38 PM, Michel Salim <michel.syl...@gmail.com>wrote: >> >> >> >> > It's currently not possible to dynamically rebind functions: >> >> > (binding [+ -] (+ 5 3)) ==> 8 ;; not 2 >> >> > Thanks, >> >> > -- >> > Michel S. >> >> It is possible to rebind (even core) functions, but there are a couple of >> limitations. One of which is the fact that some functions are inlined by the >> compiler. I believe the two argument case of '+ is one of those. >> > I just verified and it does indeed work -- thanks. Time to read up on > macros to implement this tracing construct, then. > > -- > Michel > > > -- And what is good, Phaedrus, And what is not good— Need we ask anyone to tell us these things? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---