NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
inline comments have no syntax (Score:1)
> --- ---
:
>/patpat(?#text)/
Would there be something wrong with instead allowing
either
or
or /
Re:inline comments have no syntax (Score:2)
/ x is the default # so this is a comment
and this is not a comment
At least that's what I remember from yesterday. I wish perl.com was up so I could confirm that
Re:inline comments have no syntax (Score:1)
apo5 explicitly (in text, and by examples such as the one quoted in my post above) says that to get an inline (meaning, I don't want to break my regex into two lines) comment you should assert a string.
So, inline comments don't currently have a syntax, and instead, there is explicit advice to assert a string. I'm wondering whether we can either come up with an appropriate syntax, or not explicitly advise folks to use a kludge.
It just feels like there's something amiss
Re:inline comments have no syntax (Score:2)
Go to page 6 [perl.com] and look at the table at the bottom.
The very first example shows an inline comment.
Re:inline comments have no syntax (Score:1)
Given that he defined "inline comment" to mean "I don't want to break my regex into two lines", he's very much correct. And since that's how Larry refers to inline comments, I'm inclined to agree with him on that definition.
In fact, I'll agree with him across the line: A5 is good, I couldn't do better, this is a nit pick, telling people to use a string assertion as an inline comment is a time-bomb.
Personally I don't much care if we have inline comments (even
Re:inline comments have no syntax (Score:2)
Geez, what a weird nitpick though. I agree that telling people to use inline strings is potentially a problem, but why would you insist on single-line regexes?
Do you try to keep all of you other code on one line too?
Re:inline comments have no syntax (Score:1)
> why would you insist on single-line regexes
Personally, I have zero attachment to in-line comments
in regexen. If your regex is short enough to fit on
one line with an inline comment, then it can darn well
fit on one line with a comment at the end of the line.
So, if there is no support for them, I don't mind.
However, perl5 supports them, and rather than saying
that they go away in perl6, the apo currently documents
(and recomends?) the practice of asserting a string.
*That* is my real nit pick. I think t
Re:inline comments have no syntax (Score:1)
Reply to This
Parent