develooper Front page | perl.perl6.language | Postings from August 2009

Re: Embedded comments: two proposed solutions to the comment-whole-linesproblem

Thread Previous | Thread Next
From:
Darren Duncan
Date:
August 10, 2009 15:36
Subject:
Re: Embedded comments: two proposed solutions to the comment-whole-linesproblem
Message ID:
4A80A0DA.2030801@darrenduncan.net
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.

So in combination with bracketing pairs, we could for example have this:

   #{ This is a comment. }#

That also serves to make the comments more whitespace independent, like with 
strings in general.

I think the trailing # may also resolve some other issues raised in this thread.

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.

Having # at both ends makes it easier to see at a glance where comments begin 
and end, and potentially it makes it easier to make a parser or syntax colorer.

-- Darren Duncan


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About