[Grace-core] Comment proposal

Kim Bruce kim at cs.pomona.edu
Thu Feb 5 00:26:03 PST 2015


Sorry for the confusion.

> > I could live with either of these.  At this point I lean more toward the second, but could live with the more restrictive second.
> 

Sorry, meant I could live with the more restrictive first option — only put a comment where a semicolon would be legal. (Though, based on the examples below, apparently minigrace doesn’t conform to whatever those rules are.)  My preference, however, is to allow Andrew’s list example to be legal.

At this point, however, I’d prefer not to spend too much time and effort on this.  Let’s get something simple that is easy to understand and encompasses most of the examples we have of reasonable code and allows reasonable associations of comments with code.

Whatever we do I hope we allow something like the following:

method doSomething(…) -> Done {
      … code to do stuff …

     // Don’t forget to add code here to take care of …
}

As writing note to one self about what must still be done is very useful.


> Which?
> >
> > Checking where ";" can go in Grace, the following program is legal only if print(x) is indented to the right of ;
> >
> > var x: Number := 3
> > while {false} do {;
> >                                 print(x)
> > };
> That program is not legal at all.
> > Odd, especially when the following is fine:
> >
> > while {false} do {x := x + 3;
> >     print(x)
> > };
> Neither is this one.
> > >>        • at the end of a line, (but not at the end of a continuation that is continued on the following line).
> > >>          Such comments attach to the first declaration or expression on that line.
> > > Is this the same as "may appear where a semicolon could, and attaches
> > > to the preceding statement or declaration", or is it "may appear at
> > > the end of the first physical line of a continuation-line sequence,
> > > and attaches to the whole sequence"?
> There is also a third option "may only appear at the end of a physical line that is not part of a continuation-line sequence". That is at least unambiguous.
> -Michael
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailhost.cecs.pdx.edu/pipermail/grace-core/attachments/20150205/fb642af5/attachment.html>


More information about the Grace-core mailing list