`
frenchmay
  • 浏览: 234773 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

SICP Exercise 2.17-

 
阅读更多

2.18

(define (reverse items)
  (if (null? (cdr items))
      items
      (append  (reverse (cdr items)) (list(car items)))
      )
  )

(reverse (list 1 2 3 4))
 

2.17

(define (list-pair items)
  (if (null? (cdr items))
      items
      (list-pair (cdr items))
   )
  )
(list-pair (list 1 2 3 4))
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics