Re: Two questions about eq
- From: Scott Burson <FSet.SLB@xxxxxxxxx>
- Date: Mon, 31 Mar 2008 09:11:35 -0700 (PDT)
On Mar 31, 8:49 am, Spiros Bousbouras <spi...@xxxxxxxxx> wrote:
1) The HS says that
(eq (cons 'a 'b) (cons 'a 'b))
always returns false but
(eq '(a . b) '(a . b))
might be true. Why is this ?
Because the compiler is allowed to select a canonical instance for
quoted constants (since you're not supposed to modify them). So, the
compiler could use the same cons for both occurrences of the quoted
dotted pair.
2) Under what (realistic) circumstances might
(eq 1 1) be false ?
Realistically, none, but use `eql' anyway.
-- Scott
.
- Follow-Ups:
- Re: Two questions about eq
- From: Pascal Bourguignon
- Re: Two questions about eq
- References:
- Two questions about eq
- From: Spiros Bousbouras
- Two questions about eq
- Prev by Date: Re: Two questions about prog2
- Next by Date: Re: Two questions about eq
- Previous by thread: Two questions about eq
- Next by thread: Re: Two questions about eq
- Index(es):