tuple-hashcode ( depth obj -- hash ) - Factor Documentation

tuple-hashcode ( depth obj -- hash )


Vocabulary
classes .tuple

Inputs
depth an object
obj an object


Outputs
hash an object


Definition
USING: classes classes.tuple.private kernel math math.private
sequences sequences.private ;

IN: classes.tuple

: tuple-hashcode ( depth obj -- hash )
[
[ drop 1000003 ] dip
[ class-of hashcode ] [ tuple-size ] bi
[ dup fixnum+fast 82520 fixnum+fast ] [ <iota> ] bi
] 2keep [
swapd array-nth hashcode*
integer>fixnum rot fixnum-bitxor pick fixnum*fast
[ [ fixnum+fast ] keep ] dip swap
] 2curry each drop nip 97531 fixnum+fast ; inline

AltStyle によって変換されたページ (->オリジナル) /