Currently, do (f) { x } is desugared to { x } f, that is, it lets you use a combinator like a flow control construct:
xs do (each):
(* 42) say
I figure it would be useful for success/error callbacks in async code if a do block allowed an optional else:
do (http_get) -> result:
...
else -> error:
...
So do (f) { x } else { y } would desugar to { x } { y } f or maybe { y } { x } f if that turns out to work well with more functions.
I’m not sure if this needs an equivalent to elif (eldo?) for chaining multiple do…else together. It seems logical but I don’t have a specific use case in mind.
Currently,
do (f) { x }
is desugared to{ x } f
, that is, it lets you use a combinator like a flow control construct:I figure it would be useful for success/error callbacks in async code if a
do
block allowed an optionalelse
:So
do (f) { x } else { y }
would desugar to{ x } { y } f
or maybe{ y } { x } f
if that turns out to work well with more functions.I’m not sure if this needs an equivalent to
elif
(eldo
?) for chaining multipledo
…else
together. It seems logical but I don’t have a specific use case in mind.