t3x.org / sketchy / library / append.html
SketchyLISP
Reference
  Copyright (C) 2006
Nils M Holm

append

Conformance: R5RS

Purpose: Append lists. The last argument to append may be an atom, resulting in an improper list.

Arguments:
A... - lists

Implementation:

(define (append . a)
  (letrec
    ((append2 (lambda (a b)
      (cond ((null? a) b)
        (#t (append2 (cdr a) (cons (car a) b))))))
    (_append (lambda (a b)
      (cond ((null? b) a)
        (#t (append2 (reverse a) b))))))
    (reduce _append a '())))

Example:

(append '(a b) '(c d) '(e f)) 
=> (a b c d e f)

See also:
reverse, length, map, equal?, list?.