hashtables: add a 2hashtable word that is like associate but for two key/value pairs.
parent
490523e732
commit
3c48141689
|
@ -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 )
|
||||
|
|
Loading…
Reference in New Issue