I'll chime in with my opinion on this topic.
I think the existing if-let and similar forms that have a limitation of only
allowing a single binding is a confusing restriction to place on the familiar
binding vector construct. I've always been a little uneasy about repurposing
binding vectors
It evaluates true-case only if every local binding evaluates to true values.
false-case has no access to local bindings.
(defmacro if-let-all
if-let-all evaluates every local binding sequentially and evaluates
true-case only if every local binding is a truthy value.
true-case has access to
There are several 'utility' libraries for Clojure that may have something
like this already, or their authors might be willing to add such a thing:
https://github.com/Prismatic/plumbing
https://github.com/amalloy/useful
Andy
On Tue, Jun 9, 2015 at 5:00 AM, crocket crockabisc...@gmail.com
Dunaj has support for multiple bindings in if-let since version
0.5. http://www.dunaj.org/dunaj.flow.api.html#if_let
Related design page that discusses possible approaches is
at https://github.com/dunaj-project/dunaj/wiki/Conditionals
Jozef
On Tuesday, June 9, 2015 at 4:00:35 PM UTC+2, Lars
At least based on my uses, I agree that this would likely bring the most
use of the now unused binding space in cores if-let. I can't think of any
useful alternatives.
Syntactically though, one could worry that the additional bindings would be
read as regular let bindings and worry about the
There's a variant of this in one of my projects as well.
If this is in several utility libraries *and* half the world keeps
Greenspunning versions of it in their own projects, then it might be
something that belongs in core ...
--
You received this message because you are subscribed to the
On Jun 9, 2015, at 3:51 PM, Leon Grapenthin grapenthinl...@gmail.com wrote:
Syntactically though, one could worry that the additional bindings would be
read as regular let bindings and worry about the language clarity.
One of the main points that I seem to recall from previous discussions has
I actually wish this was how the if-let macro in core worked. Once in a
blue moon I end up writing nested if-let statements or an if-let with a
nested let. Both of these cases look so ridiculous I often re-write the
the code just avoid it.
On Tuesday, June 9, 2015 at 2:00:53 PM UTC+2,
this if-let-all do not support destructure, I writed a improved
https://gist.github.com/gfZeng/8e8e18f148d5742b064c
On Tuesday, June 9, 2015 at 8:00:53 PM UTC+8, crocket wrote:
It evaluates true-case only if every local binding evaluates to true values.
false-case has no access to local