<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Like Joe said. I think that this "quote" behavior is a very practical
convenience that Scheme inherited, not something about which to hurt
one's brain trying to discern the underlying pure truths.<br>
<br>
There are some confusing bits. For example:<br>
<br>
#lang racket<br>
(equal? (quote 1) 1) ;==> #t<br>
(equal? (quote (quote 1)) (quote 1)) ;==> #f<br>
<br>
This particular confusion, we can clarify or rationalize as "(quote
<NUMBER-LITERAL>)" being a very different thing than "(quote
<LIST-LITERAL>)". Which, as you said, could be seen as
conflating.<br>
<br>
Taking another look at the above quirk suggests "quote" having
simple-minded automagic to decide which of its multiple personalities
(number or list) is triggered:<br>
<br>
(quote 1) ;==> 1<br>
(quote (quote 1)) ;==> (quote (quote 1))<br>
<br>
I don't know/recall how CL philosophizes about this. Emacs Lisp
people talked about syntax like numeric literals, "nil", and "t" being
``self-quoting.'' Scheme people tend talk about numeric literals being
``self-evaluating,'' but I don't see how that explains the quirk above.<br>
<br>
If you can work out a clean formalism for the syntax/reader that
avoids quirks like these, yet still provides the list construction
convenience that permits non-list constants/self-evals elements without
extra
syntax for quoting or unquoting them, I think that would be good.<br>
<br>
As long as you're banging around in there, if you can also replace the
names "unquote" and
"unquote-splicing" (which I believe are hardly ever used literally in
application code) with names/syntax that don't stomp on the space of
names application code might want to use in,
say, quoted or quasiquoteed embedded SXML, that would be even better.
:) I wish that RnRS had gotten rid of these at the same time that it
blessedly got rid of "nil" and "t". What currently makes more sense to
me in Racket is to move to "#unquote" and "#unquote-splicing" (or "#,"
and "#,@"), keeping the same "," and ",@" shorthand. I suspect that
changing to those would be backward-compatible for 99.9% existing code
outside of Racket internals. I could be overlooking some case that
makes that change a bad idea, of course.<br>
<br>
Joe Marshall wrote at 01/26/2011 05:17 PM:
<blockquote
cite="mid:AANLkTi=Sv68Y7qq0VmfQjX=ZCwsduPxJo8=ZTCRAiC65@mail.gmail.com"
type="cite">
<pre wrap="">On Wed, Jan 26, 2011 at 8:02 AM, J. Ian Johnson <a class="moz-txt-link-rfc2396E" href="mailto:ianj@ccs.neu.edu"><ianj@ccs.neu.edu></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have a historical question about quoted constants. Does anyone know why '1 = 1? My intuition is that this is an artifact of conflating quote with list constructors. Is that indeed the case?
</pre>
</blockquote>
<pre wrap=""><!---->
I doubt it. More likely it was when someone realized that if (quote 1) is not the number 1, then everyone would be confused. What else would it be?
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<a class="moz-txt-link-freetext" href="http://www.neilvandyke.org/">http://www.neilvandyke.org/</a>
</div>
</body>
</html>