develooper Front page | perl.perl6.language | Postings from July 2005

Re: Strange interaction between pairs and named binding

Thread Previous | Thread Next
From:
Damian Conway
Date:
July 22, 2005 18:25
Subject:
Re: Strange interaction between pairs and named binding
Message ID:
42E19C5E.6060608@conway.org
Larry wrote:

> : If the Bare code object (including pointy and non-pointy) default their
> : parameter types to "Any" (that is, Item|Pair|Junction), then all of
> : these would work:
> : 
> :     for [1..10].pairs { say(.value) }
> :     for [1..10].pairs { say($^x.value) }
> :     for [1..10].pairs -> $x { say($x.value) }
> :     for 1|2, 3|4 { say(.values) }
> :     for 1|2, 3|4 { say($^x.values) }
> :     for 1|2, 3|4 -> $x { say($x.values) }
> 
> I dunno.  I'm inclined to say that it should default to Item|Pair, and
> let people say Any explicitly if they really want to suppress autothreading.

Not surprisingly, I strongly agree with this sentiment! ;-)

Damian

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