Next: lists pred, Previous: lists conventions, Up: lists [Index]
The name stands for “eXchanged CONS”, it is like cons
but
reverses the arguments. Of utility only as a value to be conveniently
passed to higher–order procedures.
(cons 1 2) ⇒ (1 . 2) (xcons 1 2) ⇒ (2 . 1)
Return an n–element list, whose elements are all the value fill. If fill is not given, the elements of the list may be arbitrary values.
(make-list 4 'c) ⇒ (c c c c) (make-list 0) ⇒ ()
Copy the spine of the argument.
Copy the whole tree of fell, not only the spine (which is what
list-copy
does).
Return an n–element list. Element i of the list, where
0 <= i < n, is produced by (init-proc i)
.
The basic variants build the list from element 0 to element n-1. The ‘/reverse’ variants build the lists in reversed order, with element n-1 created first. The ‘/reverse’ variants may be a little faster, especially for long lists.
(list-tabulate 4 values) ⇒ (0 1 2 3)
Return a list containing the elements:
(start start+step ... start+(count-1)*step)
The start and step parameters default to 0
and
1
, respectively. count must be a non–negative number.
The resulting list is built in reverse, starting from the last element.
(iota 5) ⇒ (0 1 2 3 4) (iota 5 0 -0.1) ⇒ (0 -0.1 -0.2 -0.3 -0.4)
Next: lists pred, Previous: lists conventions, Up: lists [Index]