On Mar 8, 11:50 am, Jonathan Shore <jonathan.sh...@gmail.com> wrote: > How would I encapsulate this into a data structure to be passed into > functions efficiently? I could use a map of symbols to various structures, > but that would be inefficient in access and memory. I could bind into a > closure but then how do I evolve the closure.
Doug Hoyte's book Let Over Lambda (http://letoverlambda.com) has plenty of tips on how to hack closures, including accessing closed- over values. The book uses Common Lisp, but most of it maps easily to Clojure. The relevant chapter on anaphoric macros is not available in the free preview, unfortunately. To summarize in Clojure terms, you make a wrapper macro for fn, called, e.g., pfn. pfn then works exactly like fn, except you may also use it with some predetermined arguments. Those arguments make the closure return closed-over values. -- 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