On Thu, Sep 21, 2000 at 03:38:50AM -0400, Michael G Schwern wrote:
> On Thu, Sep 21, 2000 at 03:54:27AM -0000, Perl6 RFC Librarian wrote:
> > =head1 IMPLEMENTATION
> > 
> > Dunno. With my vague understanding of the existing code and hash
> > tables in general:
> 
> I believe the main reason why hash keys can't be references is because
> they're not really scalars.  Internally they're just normal char
> strings IIRC, not SVs.

Sure, but that is just implementation detail.

>  I'm sure at one point there were efficiency
> and memory arguments for this, but I don't know if they still hold.

Right. The hash function needs to be fast. If it has to determine
what type of SV it is then maybe call a sub it will be very
much slower.

However, that does not mean that there could not be two different
hash types internally.

No I am not saying that we want to do this, but it should not be impossible.

> The idea of promoting hash keys to true scalars has been knocked out
> before.  I'm sure you can dig up some p5p threads on the subject.

that beacause with the perl5 code base there is only one hash implementation,
so implementing this would have a huge performance hit.

Graham.

Reply via email to