Chaim Frenkel wrote:
>
> This is making the index variable into an a wrapper object.
No it isn't. Or at least it doesn't have to.
Often there is a need to find the key an object was found in a container.
More often in hashes than in arrays.
And I think this discussion belongs in -data.
> Since the underlying value can't (or shouldn't) know which of the n
> containers it is in.
The language can note the occurance of the :n attribute, backtrack to
the last array the variable was found in, and flag the access (be it
inside a for, a map, or just a simple $a = $array[4] access) to set the
attribute.
Having a reasonable limit on when this is possible, and having the
attribute be C<undef> when it is out of bounds, is within the bounds
of this proposal.
> <chaim>
> DN> for $a (@array) { print "$a is at ${a:n}\n"; }
Do I need to submit this as a formal RFC?
--
David Nicol 816.235.1187 [EMAIL PROTECTED]
- Re: RFC 120 (v2) Implicit counter in for statemen... John McNamara
- Re: RFC 120 (v2) Implicit counter in for stat... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit counter in for ... John McNamara
- Re: RFC 120 (v2) Implicit counter in for stat... Steve Simmons
- Re: RFC 120 (v2) Implicit counter in for stat... David L. Nicol
- Re: RFC 120 (v2) Implicit counter in for ... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit counter in ... Tom Christiansen
- Re: RFC 120 (v2) Implicit counte... Jonathan Scott Duff
- Re: RFC 120 (v2) Implicit co... Tom Christiansen
- Re: RFC 120 (v2) Implicit counter in ... Chaim Frenkel
- Re: RFC 120 (v2) Implicit counte... David L. Nicol
- Re: RFC 120 (v2) Implicit counter in for stat... Johan Vromans
- Re: RFC 120 (v2) Implicit counter in for ... Tom Christiansen
- Re: RFC 120 (v2) Implicit counter in for statements, p... John McNamara
