Jon Lang wrote:
smuj wrote:
smuj wrote:
Jon Lang wrote:
... the biggest potential stumbling block for this
would be the existence of a double-bracket that sees frequent use at
the start of a line.  Query: does '<<' count as a double bracket, or
as a single bracket (since it's equivalent to '«')?
[S02] {Note however that bare circumfix or postcircumfix <<...>> is not a
user-selected bracket, but the ASCII variant of the «...» interpolating word
list. Only # and the q-style quoters (including m, s, tr, and rx) enable
subsequent user-selected brackets.}
Just to clarify on that quote from S02, what I was trying to say (if I
understand the synopsis correctly) is that << counts as either single or
double depending on context. If you stick a # on the front, then << will
count as a double bracket.

Thanks for the clarification.  Either we change this so that '<<'
counts as a single bracket for inline comment purposes, or we live
with the risk of start-of-line inline comments '#<< ... >>' when
prepending #'s to comment out sections of code.

Or we leave it as is.  Is it really _that_ big of a problem to retrain
yourself to type "# " instead of "#" when commenting out lines?

It would certainly annoy a lot of people, me included! :-)

Here's a radical notion: use something other than '#' to initiate an
inline comment.

[snippage]

Or maybe just don't allow "embedded" comments unless they are actually "embedded", i.e. if a line starts with a # (ignoring leading whitespace) then it's _always_ a line-end comment, no matter what follows the #, e.g.


#blah      # line-end comment
#{         # another line-end comment

    #{     # yet another line-end comment (YALC)

some-code-here #{...}    # embedded comment


If we allow the following coding style from S02:

#sub foo                    # line end comment
 #{                         # okay, comment
   ...                      # extends
}                           # to here

then perhaps we should change the term "embedded comment" to "extended comment".

We could always have a Q form in place of #'s to achieve the above effect from S02, more like a funny heredoc, e.g.

Q :#<<<                     # embedded
sub foo                     # comment
{                           # extends
 ...                        # to
}                           # (wait for it)
>>>                         # here!

Maybe call it a "theredoc"! :-)

Cheers
--
smuj

Reply via email to