bldc/tests/test_if_2.lisp

8 lines
166 B
Common Lisp

(define test (lambda (f x)
(if (f x)
x
(test f (- x 1)))))
(= (test (lambda (x) (< x 0)) 2) -1)