bldc/tests/test_match_4.lisp

8 lines
198 B
Common Lisp

(define f (lambda (ls)
(match ls
( nil 0 )
( (?cons c) (+ (car c) (f (cdr c))))
( _ 'error-not-a-list))))
(check (= (f '()) 0))