I guess it wouldn't hurt having them available in the else, even if people won't use them often.
On Monday, May 21, 2012 7:11:05 PM UTC+2, Aaron Cohen wrote: > > On Wed, May 16, 2012 at 9:53 AM, Walter Tetzner < > robot.ninja.saus...@gmail.com> wrote: > >> On Wednesday, May 16, 2012 9:16:29 AM UTC-4, Aaron Cohen wrote: >>> >>> 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? >>> >>> >> None of the bindings should be available in the else branch, since there >> would be no way to know which will succeed before run-time. >> > > I actually think that having all the bindings available and just nil for > everything past the first failure would be more useful, and also matches > the intuition that it expands out to nested if-lets > > (if-let [a 1 b 2 c nil] [a b c]) > > > (if-let [a 1] > (if-let [b 2] > (if-let [c nil] > [a b c] > [a b c]) > [a b c]) > [a b c]) > > => [1 2 nil] > -- 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