@f0x I think it’s a useful conceptual form that *some* languages expand on well. like ruby, where it has capabilities that would be wordy and unpleasant to express in normal if/else blocks.
a = case foo when Integer, Float foo when /http(s)?/ bar else baz end
You can stick anything in a `when` that responds to the matcher method, `===`
@f0x I think it’s a useful conceptual form that *some* languages expand on well. like ruby, where it has capabilities that would be wordy and unpleasant to express in normal if/else blocks.
a = case foo
when Integer, Float
foo
when /http(s)?/
bar
else
baz
end
You can stick anything in a `when` that responds to the matcher method, `===`