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

Perilous placeholder parameters

From:
Stuart Cook
Date:
August 29, 2006 17:25
Subject:
Perilous placeholder parameters
Message ID:
49b351060608291725g283e4542y1692c357d825e7f@mail.gmail.com
On 8/30/06, Damian Conway <damian@conway.org> wrote:
> That's a little unfair. Choose good names and it's perfectly clear:
>
>      map { "Element $^array_index is called $^array_value" } <== @array.kv;

As an aside, though, doesn't that particular solution now implicitly
rely on the fact that ('index' lt 'value')?

I get the feeling that if people want to give meaningful names to
their $^ parameters, they'll have to learn to start putting
predictable alphabetic prefixes in front of them.
($^a_index/$^b_value?)

Perhaps the lesson is that if you want something more descriptive than
$^a/$^b, you should be using a pointy block instead ...


Stuart



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