标签:
drracket的cons语法好像和scheme有点不一样,scheme里是点对,drracket里cons的两个参数第二个要求是个list,也就是(cons empty 1)和(cons 1 empty)
之中,前者是不合法的。
(define (replace-eol-with alon1 alon2)
(cond
((empty? alon1) alon2)
(else (cons (first alon1) (replace-eol-with (rest alon1)
alon2)))))
(define (our-append alon1 alon2 alon3)
(replace-eol-with
(replace-eol-with alon1 alon2) alon3))
标签:
原文地址:http://www.cnblogs.com/autoria/p/4739241.html