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