Returns a list of its arguments.
(list 'a (+ 3 4) 'c) => (a 7 c) (list) => ()These expressions are equivalent:
(list obj1 obj2 ... objN) (cons obj1 (cons obj2 ... (cons objN '()) ...))
This procedure returns a newly allocated list of length k, whose elements are all element. If element is not supplied, it defaults to the empty list.
cons*
is similar tolist
, except thatcons*
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* obj1 obj2 ... objN-1 objN) (cons obj1 (cons obj2 ... (cons objN-1 objN) ...))
Returns a newly allocated copy of list. This copies each of the pairs comprising list. This could have been defined by
(define (list-copy list) (if (null? list) '() (cons (car list) (list-copy (cdr list)))))
vector->list
returns a newly allocated list of the elements of vector.
subvector->list
returns a newly allocated list of the elements of the given subvector. The inverse ofvector->list
islist->vector
.(vector->list '#(dah dah didah)) => (dah dah didah)
string->list
returns a newly allocated list of the character elements of string.
substring->list
returns a newly allocated list of the character elements of the given substring. The inverse ofstring->list
islist->string
.(string->list "abcd") => (#\a #\b #\c #\d) (substring->list "abcdef" 1 3) => (#\b #\c)