yaotti's diary

Software is Eating the World

listとquoteの違い

(find (cut eq? '+ <>) (list '+ '- '* '/))
(find (cut eq? '+ <>) '('+ '- '* '/))


この2つ、挙動が違う。
上は+が返ってきて、下は#fが返る。



なんでかなーと思って調べたところ、

gosh>(list 'a 'b)
(a b)
gosh>'('a 'b)
('a 'b)


quoteだと中身は評価されない。
わかってたはずなのに。なるほどなるほど。