hashcode* ( depth obj -- code )
Factor handbook » The language » Collections » Hashtables » Hashtable keys

Prev:hashcode ( obj -- code )
Next:identity-hashcode ( obj -- code )


Vocabulary
kernel

Inputs
depthan integer
objan object


Outputs
codea fixnum


Generic word contract
Outputs the hashcode of an object. The hashcode operation must satisfy the following properties:
If two objects are equal under =, they must have equal hashcodes.
The hashcode is only permitted to change between two invocations if the object or one of its slot values was mutated.

If mutable objects are used as hashtable keys, they must not be mutated in such a way that their hashcode changes. Doing so will violate bucket sorting invariants and result in undefined behavior. See Hashtable keys for details.

See also
hashcode, identity-hashcode

Definition

GENERIC: hashcode* ( depth obj -- code ) flushable


Methods