To try and be a little bit more clever, Ren-C added the ability of SWITCH to let the last value "fall out". So instead of writing:
rebol2>> result: switch/default "z" [
"a" [print "won't run" 10]
"b" [print "this either" 20]
][
30
]
== 30
You could just write:
>> result: switch "z" [
"a" [print "won't run", 10]
"b" [print "this either", 20]
30
]
== 30
Additionally, because Ren-C's switch cases evaluate, you could put arbitrary code and it will fall out:
>> var: "a"
>> result: switch "z" [
var [print "won't run", 10]
(first ["b" "c"]) [print "this either", 20]
10 + 20
]
== 30
It was an interesting idea of folding the default inside the same block as the clauses. It that felt a bit like being able to fold defaults inside a CASE statement using TRUE:
>> case [
1 > 2 [<nope>]
3 > 4 [<nope>]
true [<your default here>]
]
== <your default here>
But with ELSE and THEN, is this feature still interesting?
result: switch "z" [
"a" [print "won't run" | 10]
"b" [print "this either" | 20]
] else [
10 + 20
]
The fallout feature doesn't have much cost; it's nearly free. And for the performance-minded, it's the fastest way to have a default value.
Does fallout make SWITCH feel like it's fancier and has good dialecting bones, taking advantage of Rebol's unconventional-ness? Or does it make SWITCH seem weird...like you're looking at incomplete code, missing the branch for the last switch case? What do people think looking over it in the above examples?