3 ms·
I wish they showed the `else` syntax, because the traditional ALGOL-style if-then-else statement doesn't look native when shoved into most function call notatio
by spankalee 1y ago
I wish they showed the `else` syntax, because the traditional ALGOL-style if-then-else statement doesn't look native when shoved into most function call notations, unless you have something pretty interesting around named parameters and expressions delimiters.
- middayc 1y agothere is no if { } else { } in REBOL or Rye and it wouldn't really fit. There is either function that accepts two code blocks. It can act as a typical if / else or as a ternary expression as it also returns the result of a block: print either pwd = "correct" { "Hello" } { "Locked" } This is Rebol's doc on either, Rye's works exactly the same: https://www.rebol.com/docs/words/weither.html https://www.rebol.com/docs/words/weither.html
- iamevn 1y agoSee the `either` function further down either some-condition { print "was true" } { print "was false" }
- deleted 1y ago[deleted]