Damian Conway wrote:
> > > When a pair reference is assigned (in)to an array, it remains a
> > > single scalar (referential) value. So:
> > >
> > > @array = ( a=>1, b=>2, 'c', 3 );
> > >
> > > assigns four elements (not six) to @array.
> The proposed C<key> and C<value> built-ins (or the extended C<keys> and
> C<values>) would be used on a pair reference:
>
> print key $array[0]; # or perhaps: print keys $array[0];
^^^ Makes sense Mismatch ^ ^
> print value $array[0]; # or perhaps: print value $array[0];
^ 's'
But what does C<key $array[2]> do? Or C<keys @array>?
Jon
--
Knowledge is that which remains when what is
learned is forgotten. - Mr. King
- RFC 84 (v1) Replace => (stringifying comma) with =&... Perl6 RFC Librarian
- Re: RFC 84 (v1) Replace => (stringifying comma... Mike Pastore
- Re: RFC 84 (v1) Replace => (stringifying comma... Jon Ericson
- Re: RFC 84 (v1) Replace => (stringifying comma... Brad Hughes
- Re: RFC 84 (v1) Replace => (stringifying comma... Damian Conway
- Re: RFC 84 (v1) Replace => (stringifying c... Jon Ericson
- Re: RFC 84 (v1) Replace => (stringifyi... Chaim Frenkel
- Re: RFC 84 (v1) Replace => (stringifying c... Nathan Wiger
- Re: RFC 84 (v1) Replace => (stringifyi... John Porter
- Re: RFC 84 (v1) Replace => (stringifying c... John Porter
- Re: RFC 84 (v1) Replace => (stringifying comma... Chaim Frenkel
- Re: RFC 84 (v1) Replace => (stringifying comma... Damian Conway
- Re: RFC 84 (v1) Replace => (stringifying c... Piers Cawley
- Re: RFC 84 (v1) Replace => (stringifyi... Piers Cawley
- Re: RFC 84 (v1) Replace => (string... Ken Fox
- Re: RFC 84 (v1) Replace => (s... Nathan Wiger
