在《The Little Schemer》第9章的开头部分,有looking、shift、align、shuffle等几个例子,
(define looking
(lambda (a lat)
(keep-looking a (pick 1 lat) lat)))
(define shift
(lambda (pair)
(build (first (first pair))
(build (second (first pair))
(second pair)))))
(define align
(lambda (pora)
(cond ((atom? pora) pora)
((a-pair? (first pora)) (align (shift pora)))
(else (build (first pora)
(align (second pora)))))))
(define shuffle
(lambda (pora)
(cond ((atom? pora) pora)
((a-pair? (first pora))(shuffle (revpair pora)))
(else (build (first pora)
(shuffle (second pora)))))))
我想我大概理解了它们,但我不知道这些例子的提示,我是否需要有一些先决条件,有人可以告诉我吗?
最好的祝福