[The Little Schemer]or

The Little Schemer」P.21 ~


(or (null? '()) (atom? '(d e f g)))
;; => #t


(or (null? '(a b c)) (null? '()))
;; => #t


  • or likes SQL's Coalesce.


(or (null? '(a b c)) (null? '(atom)))
;; => #f


  • (or ...
    • asks two quesstions, one at a time. If the first one is true it stops and answers true. Otherwise it asks the second question and answers with whatever the second question answers.
    • 一度に二つの質問をしたとする。もし最初の一つがtrueであれば質問をやめ、trueを返す。そうでなければ、二つ目の質問をし、二つ目の質問の解を返す。

0 件のコメント: