I apologize for the double post. An emacs shortcut didn't work very
well in my firefox edit window. :-). Now to actually finish what I was
trying to type.
I was considering putting this in Rich's Clojure poll, but I wasn't
sure it was broken yet.
Is there a cleaner way to create local functions than
(let [foo (fn [x]
...)]
(foo 42))
?
I find that syntax to be slightly annoying, because you could end up
with multiple lines and a good amount indentation even in small local
functions. I find myself writing lots of small defns right before a
"real" defn that I intended to write. It would be nice if there were a
nice way t define these inside the "real" defn.
I would like to write a macro to improve this, but I don't see how you
could ever end up with the following, unless there is a way to mess
with the enclosing function's bindings
(def bar [x]
(localfn foo [y]
...)
(localfn baz [z]
...)
(foo (baz x)))
Allen
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---