Paste: cond in action

Author: prunedtree
Mode: factor
Date: Wed, 12 Nov 2008 08:56:31
Plain Text |
: cuckoo-set-at ( value key cuckoo -- )
    2dup cuckoo-lookup
    { 
        { [ pick over key>> = ]          [ 2nip store-value ] }
        { [ dup key>> ((collision)) = ]  [ nip value>> set-at ] }
        { [ pick hashcode over key>> = ] [ nip ((collision)) V{ } clone [ store ] keep set-at ] }
                                         [ drop cuckoo-insert ]
    } cond ;

New Annotation

Summary:
Author:
Mode:
Body: