「The Little Schemer」P.22 ~
- The First Commandment
- (preliminary)
- Always ask null? as the first question in expressing any function.
- 関数を評価する際は、null?手続きが常に初めの問いとなるでしょう。
(member? 'tea '(coffee tea or milk)) ;; => #t |
- because, one of the atoms of the '(coffee tea or milk), is the same as the atom tea.
- なぜなら、'(coffee tea or milk)のatomの一つと、atomであるteaは同じであるから。
(member? 'poached '(fried eggs and scrambled eggs)) ;; => #f |
自前
(define member? |
member?
(member? 'tea '(coffee tea or milk))
(member? 't '(coffee tea or milk))
(member? 'meat '(mashed potatoses and meat gravy)) |
回答
(define member? |
(member? 'tea '(coffee tea or milk))
(member? 'coke '(cofee tea or milk))
(member? 'meat '(mashed potatoses and meat gravy)) |
- cond
- else
- Is else really a question?
- Yes, else is a question whoose value is always true.
- else
- Do It, Do It Again, and Again, and Again ...
0 件のコメント:
コメントを投稿