in reply to Re^2: Preventing autovivification
in thread Preventing autovivification
In addition to this, you need to isolate the object (inside out) from the implementation (hash).
Sorry, but I think you are compounding two different goals and coming up with a lemon.
The original goals of IOOs were:
What you are suggesting is that the internal data implementation should be encapsulated (isolated) from the internal code. This was never a (stated) design goal, but can be achieved by the religious use of accessors, internally.
In short, there is no way to stop an attribute from being added to a hash data structure. Auto-vivification is just part of the behavior of hashes.
Actually, I think Hash::Util was specifically designed to address this.
|
|---|