make-listcreates and returns a list of k elements. If init is included, all elements in the list are initialized to init.Example:
(make-list 3) ⇒ (#<unspecified> #<unspecified> #<unspecified>) (make-list 5 'foo) ⇒ (foo foo foo foo foo)
Works like
listexcept that the cdr of the last pair is the last argument unless there is only one argument, when the result is just that argument. Sometimes calledcons*. E.g.:(list* 1) ⇒ 1 (list* 1 2 3) ⇒ (1 2 . 3) (list* 1 2 '(3 4)) ⇒ (1 2 3 4) (list* args '()) == (list args)
copy-listmakes a copy of lst using new pairs and returns it. Only the top level of the list is copied, i.e., pairs forming elements of the copied list remaineq?to the corresponding elements of the original; the copy is, however, noteq?to the original, but isequal?to it.Example:
(copy-list '(foo foo foo)) ⇒ (foo foo foo) (define q '(foo bar baz bang)) (define p q) (eq? p q) ⇒ #t (define r (copy-list q)) (eq? q r) ⇒ #f (equal? q r) ⇒ #t (define bar '(bar)) (eq? bar (car (copy-list (list bar 'foo)))) ⇒ #t