Jump to content

Logical operations: Difference between revisions

m
→‎{{header|Common Lisp}}: remove XOR and add note about availability in CLISP
m (→‎{{header|Common Lisp}}: remove XOR and add note about availability in CLISP)
Line 980:
(mapcar (lambda (op)
(format t "~a ~a ~a is ~a~%" a op b (eval (list op a b))))
'(and or xor)))
 
(loop for a in '(nil t) do
Line 991:
NIL AND NIL is NIL
NIL OR NIL is NIL
NIL XOR NIL is NIL
 
NIL AND T is NIL
NIL OR T is T
NIL XOR T is T
 
NOT T is NIL
T AND NIL is NIL
T OR NIL is T
T XOR NIL is T
 
T AND T is T
T OR T is T</pre>
 
T XOR T is NIL</pre>
CLISP has <tt>xor</tt>, which can be added to the list of ops in <tt>demo-logic</tt> if using that implementation, but it's not part of the standard.
 
=={{header|D}}==
1,480

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.