Re: functions as return values

2013-02-23 Thread AtKaaZ
=> ((fn [a] (backtick/template (fn [b] (+ ~(inc a) (* b b))) ) ) 5) (fn [b] (+ 6 (* b b))) https://github.com/brandonbloom/backtick => (eval ((fn [a] (backtick/template (fn [b] (+ ~(inc a) (* b b))) ) ) 5)) # => ((eval ((fn [a] (backtick/template (fn [b] (+ ~(inc a) (* b b))) ) ) 5)) 2) 10 On S

Re: functions as return values

2013-02-23 Thread Larry Travis
I am afraid I didn't ask my question clearly. Michael's "solution" would give as output (fn [b] (+ (inc a) (* b b))) What I want as output is (fn [b] (+ 6 (* b b))) ... where those expressions within the inner-lambda scope (of the original nested-lambda expression) that can be evaluated

functions as return values

2013-02-23 Thread Larry Travis
In Clojure, if I have a function call that asks for return of a function, for example user> ((fn [a] (fn [b] (+ (inc a) (* b b 5) I get the function name # But what I would like to get is an expression that defines this function, for example (fn [b] (+ 6 (* b b))) Is there some way th