@5imian @AdamRackis I've wanted it for things like:
assert('…', do {
if (…) {
… ? x(a) : y(b)
} else if (…) {
} else {
}
});
-
-
places where ternaries "work" but get out of hand fast. /cc
@littlecalculist3 replies 0 retweets 0 likes -
I see that, but I'm still not seeing the inherent value over a function, which you could also have used
1 reply 0 retweets 1 like -
it would have to be an IIFE, which is an annoying incantation
1 reply 0 retweets 0 likes -
Replying to @wycats
No he wants you to make a separate function declaration, and then call it. (I'd prefer the `do` solution)
@5imian@littlecalculist1 reply 0 retweets 0 likes -
the separate function declaration is much longer and less self-contained (a value for me).
2 replies 0 retweets 1 like -
Replying to @wycats @AdamRackis and
I want my assertions, for example, to be in one place, not scattered all over the place.
1 reply 0 retweets 1 like -
Replying to @wycats @AdamRackis and
nice benefit: it's really easy to strip them all at once with a build tool.
2 replies 0 retweets 2 likes -
Replying to @wycats @AdamRackis and
What's wrong with variables before the assertion?
1 reply 0 retweets 0 likes
nothing is "wrong" just like nothing would be wrong with disallowing anonymous functions.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.