SketchyLISP Reference |
Copyright (C) 2007 Nils M Holm |
<<[list-ref] | [Index] | [list?]>> |
Conformance: R5RS Scheme
Purpose: Extract the tail of a list beginning at a given offset. The first element is at position 0.
Arguments:
X - list
N - position of tail to extract
Implementation:
(define (list-tail x n) (cond ((zero? n) x) ((null? x) (bottom (list 'list-tail x n))) (else (list-tail (cdr x) (n- n 1)))))
Example:
(list-tail '(a b c d e f) 3) => (d e f)
See also:
caar,
append,
list-ref.
<<[list-ref] | [Index] | [list?]>> |