demerphq skribis 2006-10-08 16:01 (+0200):
> If its not obvious why this would be nice: qw() is often used as a
> list constructor for things like options or hash elements, and it
> would be convenient to have a way to selectively comment out certain
> elements. In perl 5 you have to C&P out the offending part and then
> stick it in a comment later on. Or hand hack a custom qw//, which for
> quick fixes, and stuff like that is a bit annoying.

I think that this feature fits perfectly in qqw// or «», which is
already dubbed "shell-like". Every shell that I know lets you comment
things.

If # is special, you need a way to escape or quote it. qqw already
provides this. I also believe that qqw is much more likely to be used
for constructing hashes than qw, exactly because of the quoting feature.

Shells require comments to be separated from other characters with
whitespace. I think this is a good feature to steal.

    my %foo = «
        foo   "bar baz"    # And
        quux  xyzzy        # comments
        blah  42#15        # go
        red   "#FF0000"    # here :)
    »;

works like

    my %foo = (
        foo  => "bar baz",  # And
        quux => "xyzzy",    # comments
        blah => "42#15",    # go
        red  => "#FF0000",  # here
    );

but with much less punctuation and finger strain.
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <[EMAIL PROTECTED]>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <[EMAIL PROTECTED]>

Ik vertrouw stemcomputers niet.
Zie <http://www.wijvertrouwenstemcomputersniet.nl/>.

Reply via email to