It's currently not possible to dynamically rebind functions:
(binding [+ -] (+ 5 3)) ==> 8 ;; not 2
Would this be supported in the future? It would make it easier, for
example, to extend the current tracing functionality, e.g.
(trace-in-expr [f1 f2] (f1 (f2 10))) ==>
(let [oldf1 f1 oldf2 f2]
(binding [f1 (fn [& args] (trace-fn-call 'f1 oldf1 args))
f2 (fn [& args] (trace-fn-call 'f2 oldf2 args))]
(f1 (f2 10))))
Thanks,
--
Michel S.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---