[Readable-discuss] Proposed grammar change: forbid lines with 1 n-expr that end with .

2013-07-27 Thread David A. Wheeler
I'm proposing a minor grammar change, and want to know of any objections.

Currently, in sweet-expressions, if a line has more than one neoteric-expression
and the last expression is ., the . is interpreted as the symbol
whose spelling is the single character ..  E.G.:
quote .
= (quote |.|)

I propose making this an error instead, to improve error detection.
It's fairly unusual to want this on *purpose*.  Usually . introduces
the cdr of a pair. This would detect accidental use, if you *wanted* to do this,
you'd then have to escape it - say like this:
quote |.|
= (quote |.|)

The grammar change is trivial, and makes the grammar simpler. In ANTLR/Java:
 rest returns [Object v]
-  : PERIOD /* Improper list */
-  (hspace+  pp=post_period {$v = $pp.v;}
-   | /*empty*/   {$v = list(.);})
+  : PERIOD hspace+ pp=post_period {$v = $pp.v;} /* Improper list */

A period on a line by *itself* would continue to mean that the next
line (at the same indent level) is the cdr of the given list.

Any objections?  I plan to check this into the development branch, so
we can experiment with it, but it'll be easy to pull out if there are 
objections.

--- David A. Wheeler

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss


Re: [Readable-discuss] Proposed grammar change: forbid lines with 1 n-expr that end with .

2013-07-27 Thread John Cowan
David A. Wheeler scripsit:

 Currently, in sweet-expressions, if a line has more than one 
 neoteric-expression
 and the last expression is ., the . is interpreted as the symbol
 whose spelling is the single character ..  E.G.:
 quote .
 = (quote |.|)
 
 I propose making this an error instead, to improve error detection.

Very much +1.  A misplaced single dot ought to be an error.

-- 
That you can cover for the plentifulJohn Cowan
and often gaping errors, misconstruals, http://www.ccil.org/~cowan
and disinformation in your postsco...@ccil.org
through sheer volume -- that is another misconception.  --Mike to Peter

--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831iu=/4140/ostg.clktrk
___
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss