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

Perilous placeholder parameters

Stuart Cook
August 29, 2006 17:25
Perilous placeholder parameters
Message ID:
On 8/30/06, Damian Conway <> 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.

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

Stuart Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About