On 28 December 2013 08:21, Mark Engelberg <mark.engelb...@gmail.com> wrote:
> > `with-precision` has the same limitations as bindings -- if you want to > produce, for example, a lazy sequence involving decimal arithmetic, you're > going to get burned. Maybe in some projects you can get away with just > setting a default precision for the entire project. But if you end up > needing to deal with a mixture of sequences generated with different > precisions, you're going to have major problems. > > So we have a dilemma -- it's awkward to thread decimal precision through > all operations, and binding isn't good enough. This is exactly the kind of > thing I'm talking about. To put it bluntly, binding vars is an imperfect > solution but we use it because it's the best tool we have in Clojure. > Well, there's the bound-fn macro, but you need to know ahead of time to use that. It sounds as if you want something that combines the advantages of dynamic and lexical scoping - i.e. dynamic scope that can be passed through closures. I'm not yet decided on whether this is a good idea or not - in my view, implicit arguments are generally bad news - but I'd suggest taking a look at Riddley <https://github.com/ztellman/riddley> and Sleight<https://github.com/ztellman/sleight> if you're interesting in pursuing the idea. As far as I'm aware, the only top-level Clojure forms that produce closures are fn* and deftype*. You could transform them in much the same way bound-fn works, by using lexical scope to deliver the values to an inner binding. - James -- -- 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.