Word description The equivalent of a case expression in a programming language with buitlin pattern matchining. It attempts to match the stack with each of the patterns, in order, by treating them as inverse quotations. Failure causes the next pattern to be tested.
TUPLE: cons car cdr ;
C: <cons> cons
: sum ( list -- sum )
{
{ [ <cons> ] [ sum + ] }
{ [ f ] [ 0 ] }
} switch ;