Word renaming
Monday, April 14, 2008
Several words have been renamed and moved around to make Factor more consistent:
- new -> new-sequence
- construct-empty -> new
- construct-boa -> boa
- diff -> assoc-diff
- union -> assoc-union
- intersect -> assoc-intersect
- seq-diff -> diff
- seq-intersect -> intersect
To make things symmetrical, a new word union
operates on sequences.
Somehow, seq-diff
and seq-intersect
were implemented as O(n^2)
algorithms. Now, they use hashtables and are O(n).
Lastly, a new vocabulary named ``sets’’ contains the set theoretic
words, along with a new word unique
that converts a sequence to a hash
table whose keys and values are the same. An efficient union and
intersect are implemented in terms of this word.