Jon Lang wrote:
On Mon, Aug 10, 2009 at 3:36 PM, Darren Duncan<dar...@darrenduncan.net> wrote:
Personally, I think that comments should have trailing # as well as leading
ones, so they are more like strings in that the same character is used to
mark both ends.
You mean like the following?
q[quoted text]
qq(interpolated quote)
s<pattern> = "string"
rx(pattern)
The leading # in an inline comment is akin to the q|qq|s|tr etc. of
the various pseudo-quote structures: it identifies to what purpose the
brackets are being used.
Yes, it is like you say.
A trailing # would be superfluous.
Okay, you make a point that the likes of q[] probably outweigh the use of '' or
"" in non-trivial strings.
Note that my proposal is orthogonal to other issues like double-leading # or
whatever bracketing chars are used.
Also note that if the # are treated more like delimiters, then potentially
we could also have \# to escape literal #, same as we have \' or \" etc.
Ugh. One of the reasons for the likes of q< ... >, etc. is to provide
an alternative to having to escape the delimiter by allowing you to
select a delimiter that won't clash. By making '#' a delimiter, you
remove that ability.
Still, I like the idea of #...# also being supported from the point of symmetry
with '...' and "..." also being supported, not that this is necessary.
On the other hand, if #...# were supported, I would still also want Perl to DWIM
when one uses a line of hash-marks for a visual divider line, like ###### (to 80
chars or something).
-- Darren Duncan