3 ms·
This seems like the same thing that lisp has had since forever in cond. In CL: (defun is-greater-than (x y) (cond ((< x y) T) (T nil))) As with th
by emidln 14y ago
This seems like the same thing that lisp has had since forever in cond. In CL:
(defun is-greater-than (x y)
(cond
((< x y) T)
(T nil)))
As with the erlang example, I need a T test to get an else clause, although in this particular example, the result of the cond is nil if nothing matches anyway.