by shigemk2

当面は技術的なことしか書かない

and と or

;; and 返り値は最後に評価したフォームで、いずれかが偽ならばnil
(and t t)				; => t
(and nil t)				; => nil
(and 1 2)				; => 2
(if 1 2)				; => 2
(and 1 2 3)				; => 3
;; or 返り値は最後に評価したフォームで、すべて偽ならばnil
(or nil nil)				; => nil
(or nil t)				; => t
(or nil 1 2)				; => 1
(or nil 1 2 3)				; => 1
;; ドモルガン
;; and not not -> not or
(and (not t) (not nil))			; => nil
(not (or t nil))			; => nil
;; or not not -> not and
(or (not t) (not nil))			; => t
(not (and t nil))			; => t

P65

Emacs Lispテクニックバイブル

Emacs Lispテクニックバイブル