[Grace-core] Comment proposal

Michael Homer mwh at ecs.vuw.ac.nz
Wed Feb 4 11:49:33 PST 2015


On Thu, Feb 5, 2015 at 7:56 AM, Andrew P Black <andrew.p.black at gmail.com> wrote:
>
> On Wed, Feb 4, 2015 at 12:56 PM, Kim Bruce <kim at cs.pomona.edu> wrote:
>
> I'm a little less excited about allowing them in the middle of complete
> statements, but there are some spots where I don't think it is awful:
>
>    // throw away punctuation and change to lower case:
>    thinList := myList.filter(no_punc)   // get rid of punctuation
>                               .toLower             // & change to lower
>
>
> The canonical example that I know of for end-of-line comments is something
> like
>
>     def spaces = sequence.with(
>         , "\u0020"    // SPACE
>         , "\u00A0"    // NO-BREAK SPACE
>         , "\u1680"    // OGHAM SPACE MARK
>         , "\u180E"    // MONGOLIAN VOWEL SEPARATOR
>         , "\u2000"    // EN QUAD
>         , "\u2001"    // EM QUAD
>         , "\u2002"    // EN SPACE
>         , "\u2003"    // EM SPACE
>         , "\u2004"    // THREE-PER-EM SPACE
>         , "\u2005"    // FOUR-PER-EM SPACE
>         , "\u2006"    // SIX-PER-EM SPACE
>         , "\u2007"    // FIGURE SPACE
>         , "\u2008"    // PUNCTUATION SPACE
>         , "\u2009"    // THIN SPACE
>         , "\u200A"    // HAIR SPACE
>         , "\u200B"    // ZERO WIDTH SPACE
>         , "\u202F"    // NARROW NO-BREAK SPACE
>         , "\u205F"    // MEDIUM MATHEMATICAL SPACE
>         , "\u3000"    // IDEOGRAPHIC SPACE
>         , "\uFEFF"    // ZERO WIDTH NO-BREAK SPACE
>     )
>
> I see no reason to outlaw such comments.  The existing rule about comment
> attachment works just fine for this sort of thing, which is common in every
> language that I know of.
>
> More generally, I don't understand the motivation for Michael's proposal.
> I'm all in favor of revisiting design decisions that have, in the light of a
> couple of year's experience, where a feature has proved problematic.  We are
> doing this with inheritance–delegation–code-sharing.  I'm not aware of
> problems that our existing comment rules have caused.
There have been no existing rules outside of your head, because what's
in the spec is deeply incomprehensible and everybody thus far has
ignored it. The only person who might have encountered an issue is
you, and presumably it reflects how you'd have written anyway so you
wouldn't have encountered any. I have implemented what the spec says
already, so if you're all happy with the mishmash of occasional places
where comments aren't allowed, unexpected attachment points, and
multiple attachments, and to lay things out like that, great, I don't
have to do anything more.
-Michael



More information about the Grace-core mailing list