8
(cons [p] [q]) is ((s ((s i) (k [p]))) (k [q]))
(car [lst]) is ([lst] k)
(cdr [lst]) is ([lst] (k i))
我想寫這樣
(cons [a] (cons [b] (cons [c] [nil])))
名單,這將是這樣的:
((s ((s i) (k [a]))) (k ((s ((s i) (k [b]))) (k ((s ((s i) (k [c]))) (k [nil]))))))
但我不知道如何將'nil'編譯成S,K和I組合器。有人知道嗎?
由於提前, 埃德溫·何塞Palathinkal
你可能想看看這個:http://www.cs.bath.ac.uk/~ gam23/teaching/ProgrammingIII/10lambdaprogramming.pdf – Pinochle 2009-08-14 12:50:05