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

Re: Embedded comments: two proposed solutions to thecomment-whole-lines problem

Thread Previous | Thread Next
From:
Ben Morrow
Date:
August 11, 2009 11:08
Subject:
Re: Embedded comments: two proposed solutions to thecomment-whole-lines problem
Message ID:
20090811164516.GA85196@osiris.mauzo.dyndns.org
At  6PM +0200 on 11/08/09 you (Moritz Lenz) wrote:
> Ben Morrow wrote:
> > 
> > However, I would much rather see a general syntax like
> > 
> >     (# ... )
> >     {# ... }
> >     [# ... ]
> > 
> > with no whitespace allowed between the opening bracket and the #: this
> > doesn't seem to conflict with anything. Allowing <# ... > in rules would
> > also be nice.
> 
> That severely violates the principle of least surprise. To me [#...]
> looks like an array ref which contains a comment, which is *not* what
> you propose (I think).

No, it wasn't. The idea was modelled after TT2's [%# ... %] syntax, and
other languages that mark comments just inside the delimiters.

> It also feels like a step backwards. In Perl 6 we try to make things
> clear from the beginning, not only from the second char on. Regex
> modifiers at the, anybody? or (?#...) as comments in regexes in Perl 5?
> 
> In all other cases of quote like constructs are the semantics are
> explicit first (think of Q, qx, m, <, «), the delimiter comes later.
> Changing that all of a sudden seems very unintuitive and wrong.

This appears to be leading to a :comment modifier on quotables, with
some suitable shortcut. Perhaps 'q#'? Or are we not allowed mixed alpha
and symbols? 

Ben

(I really want to suggest £, just to teach USAnians '#' isn't called
'pound'... :) )


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