User Tools


Function LENGTH

Syntax

  • length sequencen

Arguments and Values

Description

Returns the number of elements in sequence.

If sequence is a vector with a fill pointer, the active length as specified by the fill pointer is returned.

Examples

(length "abc")

3

(defparameter *str* (make-array '(3) :element-type 'character :initial-contents "abc" :fill-pointer t))

"abc"

(length *str*)

3

(setf (fill-pointer *str*) 2)

2

(length *str*)

2

Affected By

None.

Exceptional Situations

Should be prepared to signal an error of type type-error if sequence is not a proper sequence.

See Also

Notes

None.