User Tools


Function MAKE-LIST

Syntax

  • make-list size &key initial-elementlist

Arguments and Values

Description

Returns a list of length given by size, each of the elements of which is initial-element.

Examples

(make-list 5)

(NIL NIL NIL NIL NIL)

(make-list 3 :initial-element 'rah)

(RAH RAH RAH)

(make-list 2 :initial-element '(1 2 3))

((1 2 3) (1 2 3))

(make-list 0)

NIL ; ≡ ()

(make-list 0 :initial-element 'new-element)

NIL

Side Effects

None.

Affected By

None.

Exceptional Situations

Should signal an error of type type-error if size is not a non-negative integer.

See Also

Example Implementation

To be done.

Notes

None.