Structural Informatics Group (SIG) logo
Home | Projects | Demos | Downloads | Publications | Local Info | About Us | New site
Go to the first, previous, next, last section, table of contents.

length

length

type: function (subr) 
location: built-in
source file: xllist.c
Common LISP compatible: yes
supported on: all machines

SYNTAX

(length <expr> )
        <expr>          -       a list expression or string expression 

DESCRIPTION

LENGTH returns the length of the <expr>. If the <expr> is a string, the number of characters is returned. If the <expr> is a list, the number of top level elements (atoms or sublists) is returned. If the list is NIL, a 0 is returned.

EXAMPLES

(length NIL)                            ; returns 0
(length 'a)                             ; error: bad argument type
(length '(a))                           ; returns 1
(length '(1 2 3 4 5 6))                 ; returns 6
(length '(a (b c) (d (e) f) g))         ; returns 4
                                        ;
(length "12345")                        ; returns 5


Go to the first, previous, next, last section, table of contents.