[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]
Re: exists $foo[7] and delete $foo[7]
Ronald J Kimball <rjk@linguist.dartmouth.edu> writes:
>
>I'm also curious, when you add this functionality to pseudo-hashes, how
>will you distinguish between a key whose value has been deleted, and a key
>that is not present in the hash?
You don't - that is the entire point ;-)
>
>$pseudo = [ {a => 1, b => 2}, 'A', 'B' ];
>delete $pseudo->{a};
>
>Would exists($pseudo->{a}) and exists($pseudo->{c}) return the same values?
Yes.
>This is an important distinction because you can assign to $pseudo->{a},
>but not to $pseudo->{c}.
Which (IMHO) is a serious snag with pseudo-hashes ;-)
--
Nick Ing-Simmons
- References to:
-
Ronald J Kimball <rjk@linguist.dartmouth.edu>
Gurusamy Sarathy <gsar@activestate.com>
Ronald J Kimball <rjk@linguist.dartmouth.edu>
[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index][Thread Index][Top&Search][Original]