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 by the binding of the outer-lambda parameter -- that is, the expressions "a" and "(inc a)" -- have been fixed with their values, but what is then output is the resulting Clojure function definition determined by the unevaluatable remainder of the inner-lambda scope.

It occurs to me that whether what I am asking for is possible at all depends on how closures are realized within Clojure, but I think that there would be a way of realizing them in terms of source code rather than compiled code -- and that this source code wouldn't be compiled until values for their open variables become available.
  --Larry




On 2/23/13 5:50 PM, Michael Klishin wrote:

2013/2/24 Larry Travis <tra...@cs.wisc.edu <mailto:tra...@cs.wisc.edu>>

    Is there some way that I can suppress the evaluation of this
    expression?


((fn [a]
  '(fn [b] (+ (inc a) (* b b)))) 5)
--
MK


On 2/23/13 4:50 PM, Larry Travis wrote:
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

#<user$eval4164$fn__4165$fn__4166 user$eval4164$fn__4165$fn__4166@29770daa>

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 that I can suppress the evaluation of this expression?

--Larry

--
--
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
--- You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to