Re: source of functions

2012-06-21 Thread Rogier Peters
On Wed, Jun 20, 2012 at 5:16 PM, Phil Hagelberg wrote: > On Wed, Jun 20, 2012 at 8:13 AM, Rogier Peters > wrote: >> With all the higher-order functions in the new reducers, I was >> wondering if it is possible to print a generated function, like using >> (source f). > > You need serializable-fn

Re: source of functions

2012-06-20 Thread Phil Hagelberg
On Wed, Jun 20, 2012 at 8:13 AM, Rogier Peters wrote: > With all the higher-order functions in the new reducers, I was > wondering if it is possible to print a generated function, like using > (source f). You need serializable-fn for that: https://github.com/technomancy/serializable-fn -Phil -

Re: source of functions

2012-06-20 Thread Ambrose Bonnaire-Sergeant
This might possible in CLJS (?), but I don't think you can recover the source in Clojure. Thanks, Ambrose On Wed, Jun 20, 2012 at 11:13 PM, Rogier Peters wrote: > Hi, > > With all the higher-order functions in the new reducers, I was > wondering if it is possible to print a generated function, l

source of functions

2012-06-20 Thread Rogier Peters
Hi, With all the higher-order functions in the new reducers, I was wondering if it is possible to print a generated function, like using (source f). This doesn't work: user=> (defn f[x] (fn[y] (+ y x))) #'user/f user=> (def plus5 (f 5)) #'user/plus5 user=> (source plus5) Source not found nil -