2012年9月25日

unzipped list

摘要: 今天实现了一个unzipped操作,比如(list (list 1 2) (list 3 4) (list 5 6)) -> (list (list 1 3 5) (list 2 4 6))这个实现起来没有什么难度,但是scheme中的表操作折腾了好久才没错。(define (unzipped l) (if (null? l) (list '() '()) (list (cons (caar l) (car (unzipped (cdr l)))) (cons (cadar l) (cadr (unzipped (cdr l)))) ))) 阅读全文

posted @ 2012-09-25 17:55 mathlover 阅读(148) 评论(0) 推荐(0) 编辑

导航