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 '«')?  If the former,
>>> then there's a respectable chance of seeing a line that begins with
>>> '<<' which would comment out as an inline comment rather than an
>>> end-of-line comment.  If the latter, lines beginning with '<<' would
>>> still comment out as end-of-line comments.  Off the top of my head, I
>>> can't think of any other bracketing characters that are commonly
>>> doubled up.
>> [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?

Here's a radical notion: use something other than '#' to initiate an
inline comment.  I suggested before the possibility of '#:' as the
inline comment identifier; what if we reverse this, and require ':#'
instead?  This would completely remove the risk of a start-of-line
comment being confused with an inline comment.  It would be visially
lightweight.  It would be short (four characters minimum).  It
wouldn't require you to double up on anything.  And the only danger
would be if you try to insert a comment immediately after a colon,
with no intervening whitespace - which strikes me as an _extremely_
bad practice which should be discouraged regardless.  So:

   # line comment
   #(line comment)
   :# syntax error (missing brackets)
   :#(inline comment)

Jonathan "Dataweaver" Lang

Reply via email to