Next: Selecting List Components, Previous: Pairs, Up: Lists

— procedure: **list**` object ...`

Returns a list of its arguments.

(list 'a (+ 3 4) 'c) => (a 7 c) (list) => ()These expressions are equivalent:

(listobj1obj2...objN) (consobj1(consobj2... (consobjN'()) ...))

— procedure: **make-list**` k `[`element`]

(SRFI 1) This procedure returns a newly allocated list of length

k, whose elements are allelement. Ifelementis not supplied, it defaults to the empty list.(make-list 4 'c) => (c c c c)

— procedure: **cons***` object object ...`

(SRFI 1)

`cons*`

is similar to`list`

, except that`cons*`

conses together the last two arguments rather than consing the last argument with the empty list. If the last argument is not a list the result is an improper list. If the last argument is a list, the result is a list consisting of the initial arguments and all of the items in the final argument. If there is only one argument, the result is the argument.(cons* 'a 'b 'c) => (a b . c) (cons* 'a 'b '(c d)) => (a b c d) (cons* 'a) => aThese expressions are equivalent:

(cons*obj1obj2...objN-1objN) (consobj1(consobj2... (consobjN-1objN) ...))

— procedure: **list-tabulate**` k init-proc`

— procedure:**make-initialized-list**` k init-proc`

— procedure:

Returns a

k-element list. Elementiof the list, where 0 <=i<k, is produced by (init-proci). No guarantee is made about the dynamic order in whichinit-procis applied to these indices.(list-tabulate 4 values) => (0 1 2 3)

`list-tabulate`

is defined by SRFI 1.

— procedure: **list-copy**` list`

(SRFI 1) Returns a newly allocated copy of

list. This copies each of the pairs comprisinglist. This could have been defined by(define (list-copy list) (if (null? list) '() (cons (car list) (list-copy (cdr list)))))

— procedure: **iota**` count `[`start `[`step`]]

(SRFI 1) Returns a list containing the elements

(startstart+step...start+(count-1)*step)

Countmust be an exact non-negative integer, whilestartandstepcan be any numbers. Thestartandstepparameters default to 0 and 1, respectively.(iota 5) => (0 1 2 3 4) (iota 5 0 -0.1) => (0 -0.1 -0.2 -0.3 -0.4)

— procedure: **vector->list**` vector`

— procedure:**subvector->list**` vector start end`

— procedure:

`vector->list`

returns a newly allocated list of the elements ofvector.

`subvector->list`

returns a newly allocated list of the elements of the given subvector. The inverse of`vector->list`

is`list->vector`

.(vector->list '#(dah dah didah)) => (dah dah didah)

— procedure: **string->list**` string`

— procedure:**substring->list**` string start end`

— procedure:

`string->list`

returns a newly allocated list of the character elements ofstring.

`substring->list`

returns a newly allocated list of the character elements of the given substring. The inverse of`string->list`

is`list->string`

.(string->list "abcd") => (#\a #\b #\c #\d) (substring->list "abcdef" 1 3) => (#\b #\c)