Switch statement (I)
- Two components,
given
and when
-
given
takes an argument and a block
- It sets
$_
to its argument and then calls the block
-
when
also takes an argument and a block
- It smartmatches
$_
against its argument
- If the result is True, its block is executed
- And then control jumps out of the block enclosing the
when
« first
< prev
(24 / 41)
next >
last »