Next: , Previous: , Up: srfi ilists procs   [Index]


2.40.6.2 Constructors

Function: ipair ipair a d

The primitive constructor. Return a newly allocated ipair whose icar is a and whose icdr is d. The ipair is guaranteed to be different (in the sense of eqv?) from every existing object.

(ipair 'a '())                  ⇒ (a)
(ipair (iq a) (iq b c d))       ⇒ ((a) b c d)
(ipair "a" (iq b c))            ⇒ ("a" b c)
(ipair 'a 3)                    ⇒ (a . 3)
(ipair (iq a b) 'c)             ⇒ ((a b ) . c)
Function: ilist ilist object

Return a newly allocated ilist of its arguments.

(ilist 'a (+ 3 4) 'c)           ⇒  (a 7 c)
(ilist)                         ⇒  ()
Function: ipair xipair d a

Equivalent to:

(lambda (d a) (ipair a d))

Of utility only as a value to be conveniently passed to higher–order procedures.

(xipair (iq b c) 'a)            ⇒ (a b c)

The name stands for “eXchanged Immutable PAIR”.

Function: object ipair* elt1 elt2

Like ilist, but the last argument provides the tail of the constructed ilist, returning:

(ipair elt1 (ipair elt2 (ipair ... eltn)))
(ipair* 1 2 3 4)        ⇒ (1 2 3 . 4)
(ipair* 1)              ⇒ 1
Function: ilist make-ilist n
Function: ilist make-ilist n fill

Return an n–element ilist, whose elements are all the value fill. If the fill argument is not given, the elements of the ilist may be arbitrary values.

(make-ilist 4 'c)       ⇒ (c c c c)
Function: ilist ilist-tabulate n init-proc

Return an n–element ilist. Element i of the ilist, 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.

(ilist-tabulate 4 values)       ⇒ (0 1 2 3)
Function: dilist ilist-copy dilist

Copy the spine of the argument, including the ilist tail.

Function: ilist iiota count
Function: ilist iiota count start step

Return an ilist 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.

(iiota 5)               ⇒ (0 1 2 3 4)
(iiota 5 0 -0.1)        ⇒ (0 -0.1 -0.2 -0.3 -0.4)

Next: , Previous: , Up: srfi ilists procs   [Index]