Skip to content

Latest commit

 

History

History
20 lines (16 loc) · 462 Bytes

15.md

File metadata and controls

20 lines (16 loc) · 462 Bytes

{% raw %}

Extended cond

cond has been extended with the extra test (?= pat expr) which tests if the result of expr matches pat. If so, it binds the variables in pat which can be used in the cond. An optional guard is allowed here.

An example:

(cond ((foo x) ...)
      ((?= (cons x xs) (when (is_atom x)) (bar y))
       (fubar xs (baz x)))
      ((?= (tuple 'ok x) (baz y))
       (zipit x))
      ... )

{% endraw %}