On Fri, Aug 13, 2010 at 6:55 PM, Mark P. Jones <[email protected]> wrote:
> > Assume we are in an item sequence where the opening brace was explicit.
> Under these conditions, there are only three ways that a semicolon can get
> automatically inserted:
>
> Before we go further, I want to make sure I understand the context
> for this comment. In Haskell, there is no way for a semicolon to
> be inserted automatically in a section that begins with an
> explicit open brace (unless it is part of an inner construct that
> is using implicit layout). So, in your comment above, were you
> thinking of Haskell, or proposing a new approach for BitC?
>
I was attempting to do case analysis on the proposition that semicolon
insertion should happen even when the braces are explicit. But I messed up
the case analysis rather badly.
The point I was trying to make is that in all cases where the user intended
to "own" the semicolons and did so correctly, the automatic insertion
algorithm has no cause to insert.
>
> > So what I think I'm saying here is that well-formed code should never
> trip on semicolon auto-insertion, and ill-formed code is something we want
> to diagnose in any case. All that's necessary to avoid ';' insertion is to
> keep the code marginally readable by lining up starts of lines. Programmers
> with neurons do that anyway. I don't feel greatly constrained to support the
> other kind. :-)
>
> Incidentally, fans of explicit layout in Haskell often opt for
> code that looks something like this:
>
> do { x1 <- expr1
> ; x2 <- expr2
> ; x3 <- expr3
> ; expr4
> }
>
> You might also want to know that lining up starts of lines within
> an implicit layout block is precisely what triggers insertion of
> semicolons in Haskell...
That is what I meant, with the caveat that no automatic insertion needs to
happen if the token that happens to line up is ';' or if a semicolon has
already been seen. Let me work through the case analysis again when I am
more awake.
shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev