赞
踩
if … else … 的注意事项:
cond是if…else… 的扩展,能够级联实现if… else if… else…
(define (flatten sequence)
(cond ((null? sequence) '())
((list? (car sequence))
(append (flatten (car sequence))
(flatten (cdr sequence))))
(else (cons (car sequence)
(flatten (cdr sequence))))))
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。