[Grace-core] Comment proposal

Andrew P. Black black at cs.pdx.edu
Wed Feb 4 23:43:10 PST 2015


On 4 Feb 2015, at 16:40, Michael Homer <mwh at ecs.vuw.ac.nz> wrote:

> As an aside here, people keep saying this, and it is not how Fortran
> comments work. Column 6 is for continuation lines. It's a C in column
> 1 that indicates discarding the line.

You are quite right.  I’m so pleased that I had forgotten that!
> 
>> 
>>     • 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”?

I meant to say "(but not at the end of a statement or expression that is continued on the following line).
I did not take the time to formulate this precisely; it was an example of the kind of rule we might have, 
rather than a well-thought-out proposal for a pacific rule.

I don’t think that either of your versions quite captures the idea.
“May appear where a semicolon could” is right, but my “attach to the first declaration or expression on that line” was an attempt to deal with the example

	var x := 4		//  should rename x to something meaningful

The comment attaches to the var x and not to the 4

Of course, one could come up with the opposite example:

	var corners := 4	// for a quadrilateral

where the comment is intended to attach to the 4.  If this is important, then one could write

	var corners
	corners := 4 	 // for a quadrilateral

This would be easier if Grace had statements.  

		Andrew

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


More information about the Grace-core mailing list