Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Thoughts on some new operators for perl (6 or 7)

by tachyon (Chancellor)
on Mar 10, 2004 at 13:09 UTC ( #335423=note: print w/ replies, xml ) Need Help??


in reply to Thoughts on some new operators for perl (6 or 7)

my $issue =<<'THIS_IS_WHY'; You cant use =<< It is already used (at least in p5) as you can see What might be nice is more OO syntax like my $min = @list.min my $max = @list.max But you can already get almost that from [cpan://List::Util] THIS_IS_WHY print $issue

cheers

tachyon


Comment on Re: Thoughts on some new operators for perl (6 or 7)
Download Code
Re: Re: Thoughts on some new operators for perl (6 or 7)
by Juerd (Abbot) on Mar 10, 2004 at 14:09 UTC

    \@list.min

    In Perl 6 that would be @array.min, as arrays themselves are objects. Note that @list is misleading as it is an ARRAY not a LIST. In English they may be similar, but in code it is very important to make the distinction.

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      @no_matter_what_i_am_called_i_am_an_array

      The @ defines precisely what is meant.

      cheers

      tachyon

        @no_matter_what_i_am_called_i_am_an_array The @ defines precisely what is meant.

        Correct. Note that I said "misleading", not "wrong" or "incorrect" :)

        It's as misleading as @hash and %scalar are. It is of course obvious that the former is an array and the latter is a hash.

        Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

      So, you're implying that it will be illegal to use 'list' as an array name in Perl6? What on earth are you talking about?

      Also, he was backslashing the @ because \@list.min was in an interpolating heredoc.

        So, you're implying that it will be illegal to use 'list' as an array name in Perl6? What on earth are you talking about?

        No, I usually don't imply anything. I'm just saying that naming an array "list" is misleading. It is neither wrong nor illegal. Just misleading, as it might strengthen some people's beliefs that arrays and lists are the same things.

        Also, he was backslashing the @ because \@list.min was in an interpolating heredoc.

        I hadn't thought of that. I always use quotes around my heredoc terminator specification and thought non-interpolating was the default.

        Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

        Also, he was backslashing the @ because \@list.min was in an interpolating heredoc.
        For a moment, I thought so too. But then I dismissed it, as he didn't escape the $ sigils.

        Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://335423]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2014-12-28 12:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (181 votes), past polls