Dan Sugalski wrote:

For plain PerlHash PMCs, yes, they should be PMCs only. The union went into them in a fit of enthusiasm and generality. :) More specialized aggregates can hold more specialized things, but I'm not sure we're going to have a need for something that really efficiently holds multiple fundamental data types. All-ints, floats, strings, or PMCs, sure, and certainly ones with tighter restrictions on what types of PMCs can be stored, but I doubt we'll see a general need to store, say, PMCs and ints.

Hash and arrays are diffent here, IMHO. An array either stores a PMC or is an array of e.g. packed ints. Hash creation doesn't have a notation, what will be stored in the hash finally. If a lot of plain int's are stored in the hash, the current approach is faster, because there is no need to generate a PMC for holding the value - though not so space efficient.


So I'm not too sure, if we need two hashes, one for PMCs and a general one.


leo



Reply via email to