diff options
Diffstat (limited to 'src/boot/utility.boot')
-rw-r--r-- | src/boot/utility.boot | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/boot/utility.boot b/src/boot/utility.boot index 6527a07a..0b15569c 100644 --- a/src/boot/utility.boot +++ b/src/boot/utility.boot @@ -34,7 +34,7 @@ import initial_-env namespace BOOTTRAN module utility (objectMember?, symbolMember?, stringMember?, charMember?, scalarMember?, listMember?, reverse, reverse!, - lastNode, append!, copyList, substitute, substitute!) + lastNode, append!, copyList, substitute, substitute!, setDifference) --% membership operators @@ -46,7 +46,6 @@ objectMember?(x,l) == l := rest l return sameObject?(x,l) - symbolMember?(s,l) == repeat l = nil => return false @@ -154,3 +153,13 @@ substitute(y,x,s) == [h,:t] s +--% set operations + +setDifference(x,y) == + x = nil => nil + y = nil => x + l := p := [nil] + for [a,:.] in tails x | not objectMember?(a,y) repeat + p.rest := [a] + p := rest p + rest l |