Re: Length

Edi Weitz <[email protected]>
Newsgroups gmane.lisp.allegro
Message-ID <[email protected]>
"feilong" <[email protected]> writes:

> Hello,
> Why is the length of (quote '(1 2 3)) 2 not 3.
> For example:
> CG-USER(3): (length (quote '(1 2 3)))
> 2
> 
> CG-USER(5): (length  ''(1 2 3))
> 2
> 
> CG-USER(6): (length  '''(1 2 3))
> 2
> 
> CG-USER(7): (length  ''''(1 2 3))
> 
> 2
> 
> Best Greeting

'(1 2 3) is just shorthand for (quote (1 2 3)), so (quote '(1 2 3))
could also be written as (quote (quote (1 2 3))) or '(quote (1 2 3))
which clearly is a list with two elements - the symbol QUOTE is the
first element, and the list (1 2 3) is the second element.

Cheers,
Edi.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.