hashtables: add a 2hashtable word that is like associate but for two key/value pairs.

db4
Doug Coleman 2016-03-02 17:16:05 -08:00
parent 490523e732
commit 3c48141689
1 changed files with 3 additions and 0 deletions

View File

@ -150,6 +150,9 @@ M: hashtable set-at
[ 2dup hash@ set-nth-pair ] keep
hashtable boa ; inline
: 2hashtable ( value0 key0 value1 key1 -- hash )
H{ } clone [ set-at ] keep [ set-at ] keep ; inline
<PRIVATE
: collect-pairs ( hash quot: ( key value -- elt ) -- seq )