On Wed, May 16, 2012 at 9:10 AM, Walter Tetzner < robot.ninja.saus...@gmail.com> wrote:
> On Wednesday, May 16, 2012 9:01:49 AM UTC-4, Stuart Sierra wrote:How would >> multiple bindings for if-let or when-let work? Should every binding be >> testedd? Should they be and-ed together? Should it short-circuit if the >> first is false? >> >> >> I don't think there are obvious answers to those questions. >> > > Well, considering everyone on here that's answered that question said > 'AND', it seems to be obvious. > > To make the bindings work like let, where later bindings can see previous > bindings, I think the most natural way to do it is to have the bindings > behave like the maybe monad. The first time you encounter a false value, it > fails. This way, you are using 'AND', but you don't run the risk of a > NullPointerException in later bindings if a previous one fails. Saying something is obvious and then using the word monad a paragraph later is contradictory. ;) What should happen on the else branch of the if-let; which bindings are in scope and what would be their values? --Aaron -- 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