* About 'quote'
@ 2010-12-10 11:22 self
2011-01-28 16:28 ` Andy Wingo
0 siblings, 1 reply; 2+ messages in thread
From: self @ 2010-12-10 11:22 UTC (permalink / raw)
To: Guile-user
[-- Attachment #1: Type: text/plain, Size: 451 bytes --]
scheme@(guile-user)> (eq? 'abc 'abc)
$1 = #t
scheme@(guile-user)> (eq? '(+ x 1) '(+ x 1))
$2 = #f
why $1 is true and $2 is false?
when I looked for 'quoting' in the r6rs
I found it:
Different constants that are the value of aquote expression may share the same locations
I think:
'abc ' is a constant, so the first 'abc eq the second 'abc,
and what about (+ x 1)?
I missing about how 'quote' act on non-constant?
my english is poor, sorry to that
[-- Attachment #2: Type: text/html, Size: 757 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: About 'quote'
2010-12-10 11:22 About 'quote' self
@ 2011-01-28 16:28 ` Andy Wingo
0 siblings, 0 replies; 2+ messages in thread
From: Andy Wingo @ 2011-01-28 16:28 UTC (permalink / raw)
To: self; +Cc: Guile-user
On Fri 10 Dec 2010 12:22, self <lispor@163.com> writes:
> scheme@(guile-user)> (eq? 'abc 'abc)
> $1 = #t
> scheme@(guile-user)> (eq? '(+ x 1) '(+ x 1))
> $2 = #f
>
> why $1 is true and $2 is false?
> when I looked for 'quoting' in the r6rs
> I found it:
> Different constants that are the value of a quote expression may share the same locations
*May* is the crucial word here. May, but not *must*. Implementations
are free to allocate identical quoted lists in the same place, or in
different places. If they are in different places, they are not eq?.
Andy
--
http://wingolog.org/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-28 16:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-10 11:22 About 'quote' self
2011-01-28 16:28 ` Andy Wingo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).