sequences.abbrev: keep insertion order

db4
Maximilian Lupke 2009-07-20 20:18:13 +02:00
parent e3ec2b6c8b
commit ea7cbd2b5a
2 changed files with 2 additions and 2 deletions

View File

@ -1,7 +1,7 @@
USING: assocs sequences.abbrev tools.test ; USING: assocs sequences.abbrev tools.test ;
IN: sequences.abbrev.tests IN: sequences.abbrev.tests
[ { "help" "hello" } ] [ [ { "hello" "help" } ] [
"he" { "apple" "hello" "help" } abbrev at "he" { "apple" "hello" "help" } abbrev at
] unit-test ] unit-test

View File

@ -12,7 +12,7 @@ IN: sequences.abbrev
[ prefixes ] keep 1array '[ _ ] H{ } map>assoc ; [ prefixes ] keep 1array '[ _ ] H{ } map>assoc ;
: assoc-merge ( assoc1 assoc2 -- assoc3 ) : 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> PRIVATE>