Newsgroups: comp.lang.scheme
Path: cantaloupe.srv.cs.cmu.edu!bb3.andrew.cmu.edu!newsfeed.pitt.edu!godot.cc.duq.edu!newsgate.duke.edu!news.mathworks.com!newsfeed.internetmci.com!swrinde!sdd.hp.com!col.hp.com!cello.hpl.hp.com!hplntx!hplntx.hpl.hp.com!gjr
From: gjr@hplgr2.hpl.hp.com (Guillermo (Bill) J. Rozas)
Subject: Re: constants and eq?
Sender: news@hpl.hp.com (HPLabs Usenet Login)
Message-ID: <GJR.96Jun11103725@hplgr2.hpl.hp.com>
In-Reply-To: qobi@eesun.technion.ac.il's message of Sun, 9 Jun 1996 12:44:15 GMT
Date: Tue, 11 Jun 1996 17:37:25 GMT
Reply-To: gjr@hpl.hp.com
References: <QOBI.96Jun9154415@eesun.technion.ac.il>
Nntp-Posting-Host: hplgr2.hpl.hp.com
Organization: Hewlett-Packard Laboratories, Palo Alto, CA
Lines: 34

In article <QOBI.96Jun9154415@eesun.technion.ac.il> qobi@eesun.technion.ac.il (Jeffrey Mark Siskind) writes:

|   From: qobi@eesun.technion.ac.il (Jeffrey Mark Siskind)
|   Date: Sun, 9 Jun 1996 12:44:15 GMT

|   I am trying to read R4RS with a lawyer's eye. Can someone tell me whether
|   the following must return #t or whether it is allowed to return #f:
|
|   (define (c) '(a))
|   (eq? (c) (c))
|
|   In other words, can each invocation of a literal expression return
|   a different object? If so, it would license source to source
|   transformation rules like the following:
|
|   (quote (c)) ==> (<list> (quote c)) where <list> is bound to the LIST procedure.
|
|   which could be used to eliminate all nonscalar literal expressions.

I don't know whether the R4RS allows it, I would have to check and I
don't have one with me.

However, I can guarantee that if your implementation makes it return
#f, a lot of code will break.

The implicit assumption is that the quoted list is created by the
reader and then merely manipulated as an already-constructed object.

Constant lists are often used as tags and their eq?-ness is used to profit.

If you had used backquote, however, the story would have been somewhat
different.

Why do you need to eliminate all non-scalar literal expressions?
