Next: Cutting and Pasting Lists, Previous: Construction of Lists, Up: Lists [Contents][Index]
Returns #t if object is a proper list, otherwise returns
#f. By definition, all proper lists have finite length and are
terminated by the empty list. If object is a circular list,
returns #f.
Any object satisfying this predicate will also satisfy exactly one
of pair? or null?.
(list? (list 'a 'b 'c)) ⇒ #t (list? (cons* 'a 'b 'c)) error→ (list? (circular-list 'a 'b 'c)) ⇒ #f
Returns #t if object is a circular
list, otherwise returns #f.
(circular-list? (list 'a 'b 'c)) ⇒ #f (circular-list? (cons* 'a 'b 'c)) ⇒ #f (circular-list? (circular-list 'a 'b 'c)) ⇒ #t
Returns #t if object is an improper
list, otherwise returns #f.
(dotted-list? (list 'a 'b 'c)) ⇒ #f (dotted-list? (cons* 'a 'b 'c)) ⇒ #t (dotted-list? (circular-list 'a 'b 'c)) ⇒ #f
Returns the length of list. Signals an error if list isn’t a proper list.
(length (list 'a 'b 'c)) ⇒ 3 (length (cons* 'a 'b 'c)) error→ (length (circular-list 'a 'b 'c)) error→
Clist must be a proper, dotted, or circular list. If
clist is a circular list, returns #f, otherwise returns
the number of pairs comprising the list (which is the same as the
length for a proper list).
(length+ (list 'a 'b 'c)) ⇒ 3 (length+ (cons* 'a 'b 'c)) ⇒ 2 (length+ (circular-list 'a 'b 'c)) ⇒ #f
Returns #t if object is the empty list; otherwise returns
#f.
(null? '()) ⇒ #t (null? (list 'a 'b 'c)) ⇒ #f (null? (cons* 'a 'b 'c)) ⇒ #f (null? (circular-list 'a 'b 'c)) ⇒ #f
List is a proper or circular list. This procedure returns
#t if the argument is the empty list (), and #f
if the argument is a pair. It is an error to pass this procedure any
other value. This procedure is recommended as the termination
condition for list-processing procedures that are not defined on
dotted lists.
Returns the kth element of list, using zero-origin indexing.
The valid indexes of a list are the exact non-negative integers
less than the length of the list. The first element of a list has index
0, the second has index 1, and so on.
(list-ref '(a b c d) 2) ⇒ c
(list-ref '(a b c d)
(exact (round 1.8)))
⇒ c
(list-ref list k) is equivalent to
(car (drop list k)).
Returns the specified element of list. It is an error if
list is not long enough to contain the specified element (for
example, if the argument to seventh is a list that contains only
six elements).
Next: Cutting and Pasting Lists, Previous: Construction of Lists, Up: Lists [Contents][Index]