On Jan 28, 2013 1:59 PM, "David A. Wheeler" <dwhee...@dwheeler.com> wrote:
>
> The current testsuite says that in sweet-expressions the following should
mean "(foo (a b) . c)":
> foo
> ! a b
> ! .
> ! c
>
> SHOULD it mean that? My ANTLR BNF doesn't do that, it just treats lone
"." as a period, but we *did* support that previously.
>
It's a minor point, but I think it's good to support:
1. for the same reason improper list notation exists in the first place -
one shouldn't be forced to rewrite a long structure in a different style
(t-expr -> s-expr) just because the end is improper.
2. consistency & least surprise - somebody who doesn't know the spec y
heart generally assumes "it's like s-exprs but with indentation", so
guessing that this means an improper list is natural.
I suspect the mental model many people will build a is a *textual*
isomorphism between t-exprs and s-exprs, not an isomorphism between t-exprs
and lists, so keeping t/s as similar as possible is good.
3. is silently treating "." as a period symbol ever done in schemes/lisp?
*If* we don't support this notation for improper, I'd expect it to be an
error, not a "." symbol. Or perhaps, specify that implementations SHOULD
do whatever they do for a . at top level?
BTW, the old implementation did some funny things with ., e.g. ". a b" is a
- with b silently ignored, similarly "a . b . c" is a . b, and a top-level
. is ()...
> It also has said that lone abbreviation on a line, followed by an indent,
applies that abbreviation to the body. E.G., this would mean "(quote (aaa
bbb))":
> '
> ! (aaa bbb)
>
> Again, my ANTLR BNF doesn't do that, but we used to. This one is
debatable, since you can get the same effect with the word "quote" in
Scheme (though that reasoning doesn't apply to Common Lisp).
>
If it works on the same line:
' (aaa bbb)
then it should also work with an indent. Consistency, easier to remember,
least surprise...
The quote argument would equally apply to single-line use.
BTW, your new implementation supports
'
a
==> 'a
which should perhaps be an error instead.
What's worse, what it currently does for quote INDENT is very weird:
'
a b
c d
==> ((quote a) b (c d))
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss