[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]

RE: exists $foo[7] and delete $foo[7]



>There has been some discussion of the use of attributes as compiler
>hints: it might give a cleaner language for all if the pseudohash
>became a different type of internal storage for a hash, prompted by
>such a compiler hint, with no visible changes to the mechanisms for
>access of either hash or array. This implies that you would not be
>able to see the pseudohash-as-array at all at the Perl level, except
>perhaps by asking Devel::Peek about it. Similarly, you could hint
>that an array was expected to be sparse, and the compiler could
>choose to store that internally as a hash.

I would be more comfortable with this also.  Exposing the underlying array
for a pseudohash feels to me like an implementation detail that should only
be of concern to XS programmers.  When I'm not thinking like an XS
programmer, I'd like to not have to worry about this.

When we are ready for true sparse arrays (where #slots < scalar(@ary), maybe
we should all debate this again.
===============================================
Mark Leighton Fisher            fisherm@tce.com
Thomson Consumer Electronics    Indianapolis IN
"Browser Torture Specialist, First Class"


[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]