(This originated on the chibi-scheme list, but it transcends Chibi, so I
am cross-posting to the WG1 and scheme-reports lists. The usual apologies
for dupes.)
Alex Shinn scripsit:
> On Mon, Apr 16, 2012 at 1:37 PM, Alan Watson <alan@alan-watson.org> wrote:
> > Consider:
> >
> > a'b
> >
> > According to the grammar rules, this is the identifier |a| followed by
> > the token ' followed by the token |b|. However, the third paragraph
> > of §7.1.1 says: "Identifiers that do not begin with a vertical bar
> > are terminated by a ⟨delimiter⟩ or by the end of the input." Since
> > ' is not a delimiter, this input is invalid.
[snip]
> The general policy is that Chibi implements what is simplest, so long
> as it obeys the standard and isn't overly surprising. By far the
> simplest thing to do here is to treat it as a delimiter, and this is
> what many other implementations do.
I tested "(list 'a'b)" on 42 Schemes. (Note: I am no longer testing with
both Ikarus and Vicare, just with Vicare. They usually give the same
answer, and if not, it's usually a bug or implementation gap in Ikarus,
which is no longer being developed.)
Returned (a b): Racket, Gauche, MIT, Gambit, Chicken, Scheme48/scsh,
Kawa, Chibi, Chez, Vicare, NexJ, STklos, KSi, SigScheme, Scheme 9, BDC,
XLisp, Rep, Oaklisp, Spark, Owl Lisp
Returned (a'b): Bigloo, Guile, SISC, SCM, Shoe, TinyScheme, Dream,
Scheme 7, Schemik, Elk, UMB, VX, Sizzle, Inlab
Syntax error: Vicare, Ikarus, Mosh, IronScheme, SXI, MScheme
I suspect that a lot of implementations think it's simplest to
just gobble up what they see until they get to an unquestioned
delimiter.
--
John Cowan http://www.ccil.org/~cowan cowan@ccil.org
"After all, would you consider a man without honor wealthy, even if his
Dinar laid end to end would reach from here to the Temple of Toplat?"
"No, I wouldn't", the beggar replied. "Why is that?" the Master asked.
"A Dinar doesn't go very far these days, Master. --Kehlog Albran
Besides, the Temple of Toplat is across the street." The Profit