develooper Front page | perl.perl6.internals | Postings from July 2002

RE: RFC - Hashing PMC's <albie@alfarrabio.di.uminho.pt>

From:
Brent Dax
Date:
July 22, 2002 14:05
Subject:
RE: RFC - Hashing PMC's <albie@alfarrabio.di.uminho.pt>
Message ID:
000b01c231c4$717a0b90$6501a8c0@deepblue
Dan Sugalski:
# At 5:52 PM +0100 7/22/02, Alberto Manuel Brandão Simões wrote:
# >Dan, can we create this new vtable method? returning an 
# integer (long 
# >integer)... with name hashValue, or asHash.. or something else.
# 
# Yep. Call it id and have it return an INTVAL.

Can we have it return a string instead, and then hash the string?
Strings tend to be able to carry more data--how do you come up with an
integer ID for this?

	new Math::BigFloat('3.1415926535897932384626433832795');

While it may not make much of a difference for things like aggregates:

	ARRAY=0xDECAF

It'll be quite useful for value types:

	Math::BigFloat=3.1415926535897932384626433832795

which often can't be adequately expressed as an integer while still
having different instances of the same value be equivalent.

Beyond that, I would like to specifically request that PMCs *not* hash
themselves.  They should return a value that the aggregate hashes.  That
makes it much easier to change the hashing algorithm later.

--Brent Dax <brentdax@cpan.org>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

He who fights and runs away wasted valuable running time with the
fighting.




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About