From: ··········@gmail.com
Subject: (list 'quote 123)
Date: 
Message-ID: <1180029682.013946.129940@r19g2000prf.googlegroups.com>
Why does (list 'quote 123) evaluate to '123 and not (quote 123) ?

> (list 'quote 123)
'123

> (list 'quote 123 456)
(QUOTE 123 456)

> (list 456 'quote 123)
(456 QUOTE 123)

--
Vaibhav

From: Glenn Willen
Subject: Re: (list 'quote 123)
Date: 
Message-ID: <slrnf5bmoq.k0.gwillen@unix-ns.wv.cc.cmu.edu>
On 2007-05-24, ··········@gmail.com <··········@gmail.com> wrote:
> Why does (list 'quote 123) evaluate to '123 and not (quote 123) ?
>
>> (list 'quote 123)
> '123
>
>> (list 'quote 123 456)
> (QUOTE 123 456)
>
>> (list 456 'quote 123)
> (456 QUOTE 123)

Because 'X is actually syntactic sugar for (quote X); the two expressions are
the same. The pretty-printer is taking the expression (quote X) and
"re-sugaring" it before displaying it; it will only do so with things that
could actually have been generated by the 'X abbreviation, which means lists of
length two whose first element is the symbol QUOTE. Other things it will leave
alone (as you see with your longer lists, or lists not beginning with QUOTE.)

The important point is that it _does_ evaluate to (quote 123) -- the
difference is purely one of display, and is actually an illusion.

-- Glenn Willen
From: Alan Crowe
Subject: Re: (list 'quote 123)
Date: 
Message-ID: <864pm283uu.fsf@cawtech.freeserve.co.uk>
··········@gmail.com writes:

> Why does (list 'quote 123) evaluate to '123 and not (quote 123) ?
> 
> > (list 'quote 123)
> '123

CL-USER> (write (list 'quote 123) :pretty nil)

(QUOTE 123)

'123

It is the pretty printer that is recognising 
(quote . (123 . nil)) and printing it '123

Turn off the pretty printer and
(quote . (123 . nil)) is printed (quote 123)

Alan Crowe
Edinburgh
Scotland
From: ··········@gmail.com
Subject: Re: (list 'quote 123)
Date: 
Message-ID: <1180095501.921451.160630@x18g2000prd.googlegroups.com>
On May 24, 11:37 pm, Alan Crowe <····@cawtech.freeserve.co.uk> wrote:
> ··········@gmail.com writes:
> > Why does (list 'quote 123) evaluate to '123 and not (quote 123) ?
>
> > > (list 'quote 123)
> > '123
>
> CL-USER> (write (list 'quote 123) :pretty nil)
>
> (QUOTE 123)
>
> '123
>
> It is the pretty printer that is recognising
> (quote . (123 . nil)) and printing it '123
>
> Turn off the pretty printer and
> (quote . (123 . nil)) is printed (quote 123)

Thanks.. that answers it for me.

Although I found that CLISP still prints (write (list 'quote
123) :pretty nil) as '123, while SBCL properly prints (QOUTE 123). Why
is CLISP showing such behaviour?

--
Vaibhav
From: Christian Haselbach
Subject: Re: (list 'quote 123)
Date: 
Message-ID: <f3955g$oce$1@online.de>
··········@gmail.com wrote:
> Although I found that CLISP still prints (write (list 'quote
> 123) :pretty nil) as '123, while SBCL properly prints (QOUTE 123). Why
> is CLISP showing such behaviour?

As stated in the other answers, both behaviours are semantically 
equivalent. So it is up to the implementation to decide how to display it.

IIRC there was a discussion about which behaviour is better in this 
group not too long ago.

Regards,
Christian