18 ms·
I quite like Lisp 'cause I can do silly things like: (defun sum-triplet? (list) (declare (type List list)) (and (= (length list) 3) (destruc
by tmtvl 2y ago
I quite like Lisp 'cause I can do silly things like:
(defun sum-triplet? (list)
(declare (type List list))
(and (= (length list) 3)
(destructuring-bind (a b c)
list
(and (numberp a)
(numberp b)
(numberp c)
(= (+ a b) c)))))
(deftype Sum-Triplet ()
'(and List
(satisfies sum-triplet?)))