The BNF tweak I posted earlier may make it not TOO hard to implement 
$-at-the-end with the varying indents, per Beni Cherniavsky-Paskin.  That's not 
completely clear to me, but... maybe.  With the following change, ANTLR claims 
that the grammar is unambiguous, and if the indentation processor will generate 
partial dedents for an indented line between current and parent, I think it's 
work:
-        | comment_eol indent sub_b=body {$v = append($head.v, list($sub_b.v));}
+        | comment_eol indent sub_b=body
+          ( dedent_partial partial_out=body
+             {$v = append(append($head.v, list($sub_b.v)), $partial_out.v);}
+           | empty {$v = append($head.v, list($sub_b.v));} ) )


Of course, the other part is, SHOULD we do something like this?  In particular, 
can we do without? The key use case for $-at-the-end that I've seen is let 
statements, e.g.:

let $
! ! x $ compute 'x
! ! y $ compute 'y
! body...
; ==> (let ((x (compute 'x)) (y (compute 'y))) body...)

and:

let $
! ! x $ compute 'x
! body...
; ===> (let ((x (compute 'x))) body...)



We can support these two use cases easily WITHOUT supporting $-at-the-end with 
varying child indentation, just using the current draft notation.  Examples:
let
! \\
! ! x $ compute 'x
! ! y $ compute 'y
! body...
; ==> (let ((x (compute 'x)) (y (compute 'y))) body...)

For the one-variable case, we can do:
let $
! $ x $ compute 'x
! body...
; ===> (let ((x (compute 'x))) body...)


--- David A. Wheeler


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Readable-discuss mailing list
Readable-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to