Adding combine word to new-sets

db4
Daniel Ehrenberg 2010-02-24 13:34:24 -06:00
parent 04878057af
commit 22edb2ea0d
2 changed files with 5 additions and 0 deletions

View File

@ -38,3 +38,5 @@ IN: new-sets.tests
[ { 1 2 3 } ] [ HS{ 1 2 3 } { } set-like natural-sort ] unit-test
[ HS{ 1 2 3 } ] [ { 1 2 3 } fast-set ] unit-test
[ { 1 2 3 } ] [ { { 1 } { 2 } { 1 3 } } combine ] unit-test

View File

@ -63,3 +63,6 @@ M: sequence members fast-set members ;
USE: vocabs.loader
"hash-sets" require
: combine ( sets -- set )
f [ union ] reduce ;