sequences.abbrev: keep insertion order
parent
e3ec2b6c8b
commit
ea7cbd2b5a
|
@ -1,7 +1,7 @@
|
|||
USING: assocs sequences.abbrev tools.test ;
|
||||
IN: sequences.abbrev.tests
|
||||
|
||||
[ { "help" "hello" } ] [
|
||||
[ { "hello" "help" } ] [
|
||||
"he" { "apple" "hello" "help" } abbrev at
|
||||
] unit-test
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ IN: sequences.abbrev
|
|||
[ prefixes ] keep 1array '[ _ ] H{ } map>assoc ;
|
||||
|
||||
: assoc-merge ( assoc1 assoc2 -- assoc3 )
|
||||
tuck '[ over _ at dup [ prepend ] [ drop ] if ] assoc-map assoc-union ;
|
||||
tuck '[ over _ at dup [ append ] [ drop ] if ] assoc-map assoc-union ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
|
|
Loading…
Reference in New Issue