Only two special forms are provided for this in STKLOS: match-case
and match-lambda
.
match-case key clause... | STKLOS syntax |
The argument key may be any expression and each clause has the form
(pattern s-expression...) Semantics: A The equality predicate used is (match-case '(a b a) ((?x ?x) 'foo) ((?x ?- ?x) 'bar)) => bar |
The following syntax is also available:
match-lambda clause... | STKLOS syntax |
It expands into a lambda-expression expecting an argument which, once
applied to an expression, behaves exactly like a ((match-lambda ((?x ?x) 'foo) ((?x ?- ?x) 'bar)) '(a b a)) => bar |