Next: srfi list spec pred, Previous: srfi list spec intro, Up: srfi list spec [Index]
R5RS The primitive constructor. Return a newly allocated pair whose
car is a and whose cdr is d. The pair is guaranteed to be
different (in the sense of eqv?
) from every existing object.
(cons 'a '()) => (a) (cons '(a) '(b c d)) => ((a) b c d) (cons "a" '(b c)) => ("a" b c) (cons 'a 3) => (a . 3) (cons '(a b) 'c) => ((a b) . c)
R5RS Return a newly allocated list of its arguments.
(list 'a (+ 3 4) 'c) => (a 7 c) (list) => ()
Defined as (lambda (d a) (cons a d))
. Of utility only as a value
to be conveniently passed to higher–order procedures.
(xcons '(b c) 'a) => (a b c)
The name stands for “eXchanged CONS”.
Like list
, but the last argument provides the tail of the
constructed list, returning:
(cons elt1 (cons elt2 (cons ... eltn)))
This function is called list*
in Common Lisp and about half of
the Schemes that provide it, and cons*
in the other half.
(cons* 1 2 3 4) => (1 2 3 . 4) (cons* 1) => 1
Return an n–element list, whose elements are all the value fill. If the fill argument is not given, the elements of the list may be arbitrary values.
(make-list 4 'c) => (c c c c)
Return an n–element list. Element i of the list, where
0 <= i < n
, is produced by (init-proc i)
. No guarantee is
made about the dynamic order in which init-proc is applied to
these indices.
(list-tabulate 4 values) => (0 1 2 3)
Copy the spine of the argument.
Construct a circular list of the elements.
(circular-list 'z 'q) => (z q z q z q ...)
Return a list containing the elements:
(start start+step ... start+(count-1)*step)
The start and step parameters default to 0
and
1
, respectively. This procedure takes its name from the
APL primitive.
(iota 5) => (0 1 2 3 4) (iota 5 0 -0.1) => (0 -0.1 -0.2 -0.3 -0.4)
Next: srfi list spec pred, Previous: srfi list spec intro, Up: srfi list spec [Index]