RosettaCodeData/Task/Logical-operations/Common-Lisp/logical-operations.lisp

9 lines
271 B
Common Lisp
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
(defun demo-logic (a b)
(mapcar (lambda (op)
(format t "~a ~a ~a is ~a~%" a op b (eval (list op a b))))
'(and or)))
(loop for a in '(nil t) do
(format t "NOT ~a is ~a~%" a (not a))
(loop for b in '(nil t) do (demo-logic a b) (terpri)))