- :logical
case
match given argument against different values and execute corresponding block
Parameters
case argument :any matches :dictionary :block
Returns
Examples
copyx: 2 ; the main block is always evaluated! case x [ 1 -> print "x is one!" 2 -> print "x is two!" any -> print "x is none of the above" ] ; x is two!
copykey: "one" case key [ "one" 1, ; we can also return "two" 2 ; simple constant values directly ] ; => 2
copycase "hello" #[ hello: "hola" adios: "goodbye" ] ; => "hola"