[Grace-core] Comment proposal

Michael Homer mwh at ecs.vuw.ac.nz
Sat Feb 7 22:04:48 PST 2015


On Sun, Feb 8, 2015 at 6:36 PM, Andrew P. Black <black at cs.pdx.edu> wrote:
> Can we please move this discussion to the wiki.  At least there one
> can comment about the comments in place!
A wiki is not a discussion forum. It is is almost maximally unsuited
for the task.
> In contrast, since our only kind of comment is from // to end of line, it
> seems obvious that such comments apply to the code at the start of that
> line, rather than to the code on the next line.
That seems like a pretty big leap*. If you're comfortable only ever
having a single line of comment about anything then it is consistent,
though.

* Unless you mean a case like "var x // y is used to ... \ var y", but
that would be a wilfully perverse thing to write and is clearly not
the proposal. Whole-line comments I would expect to refer to the next
line.
> Michael wrote: "Possibly a comment without other attachment at the top of a
> block can be attached to the block …  That is [a] case that's hard to handle
> otherwise.”  I think that’s correct (it would be weird to have such a
> comment at the end of the block), and it’s the reason for the existing rule
> that says that a comment following a blank line is attached to the largest
> following unit.
Hang on, what? That is exactly the opposite of how that rule would
behave, surely. You can never usefully have a block literal
immediately follow blank lines and comments.
> Rules like "comments are permitted only where semicolons are permitted - and act like semicolons” are simple only to those who know about semicolons.
It isn't simple at all when you get an indentation error because your
comment has silently terminated the logical line.
-Michael



More information about the Grace-core mailing list