Re: RFC: multiline comments
[email protected] (Glenn Linderman) Thu, 03 Aug 2000 18:33:58 -0700
| Newsgroups | perl.perl6.language.mlc |
|---|---|
| Organization | Glenn and Elaine Linderman, at home |
| Message-ID | <[email protected]> |
Michael Mathews wrote: > [I've cc'd your comment to the MLC sublist] I've still got nothing from it, as yet. > Glenn Linderman pointed out: > > I think you missed something in reading my proposal, perhaps you thought > my #<< > > and #< syntaxes were alternatives? I see them as working together, one > for > > multi-line comments and one for in-line comments, with # for end-of-line > > comments. > > > > I'd rewrite your example below, as > > code here; > > #<<END_OF_COMMENT > > # this is a single line comment > > $foo = $a + $b #< here's an in-line comment ># + $c * $d; > > END_OF_COMMENT > > more code here; > > Ooohh...!!! I see now. > > However I fail to see the need for both. Can you give an example of where I > could'nt use #<...># in place of #<< ? Well, if you vote my way on my comments in my original message on this topic, #< ># would be intentionally restricted to 1 line; hence any time you want a multiline, you couldn't use #< >#. The reasoning behind it was that if < already appears as the first character in some existing comments, that the compiler could catch it by the end of the line, and have a good likelihood of not executing the script with the erroneous interpretation of the comment. The "#<<token" syntax was perceived to be (1) too verbose for in-line comments, (2) long enough that it wasn't likely to appear in an existing comment by accident, and (3) the likelihood of finding 'token' at the beginning of a line to satisfy the compiler without error if it did appear in an existing comment would be extremely low. These 3 points don't hold for #< >#. > BTW: I've been playing and I found that this looks cool and also works under > perl5: > > <<'#'; > some commented lines > # > > so your #<< sytax enjoys the benefit of looking a lot like Perl! > > --Michael This being the "string in a void context" concept that someone else wanted to have printed to the default output filehandle... -- Glenn ===== There are two kinds of people, those who finish what they start, and so on... -- Robert Byrne _____NetZero Free Internet Access and Email______ http://www.netzero.net/download/index.html