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]

Reply via email to