What does appending two lists like this return one list rather than a cons cell of two lists?

前端 未结 0 1946
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-24 03:34

A common and simple way of appending two lists is as follows:

(define (append a b)
  (if (null? a)
      b
      (cons (car a) (append (cdr a) b))))
相关标签:
回答
  • 消灭零回复
提交回复
热议问题