Skip to content

Commit

Permalink
moved operator definitions and added toList
Browse files Browse the repository at this point in the history
  • Loading branch information
mahrud committed May 8, 2024
1 parent e060e45 commit 89b45a7
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions M2/Macaulay2/m2/set.m2
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,6 @@ unique VisibleList := x -> (

repeats = L -> #L - #unique L

-- we've been waiting to do this:
binaryOperators = unique binaryOperators
prefixOperators = unique prefixOperators
postfixOperators = unique postfixOperators
flexibleOperators = unique flexibleOperators
fixedOperators = unique fixedOperators
allOperators = unique allOperators

isSubset(Set,Set) := Boolean => (S,T) -> all(S, (k,v) -> T#?k)

isSubset(VisibleList,Set) := Boolean => (S,T) -> all(S, x -> T#?x)
Expand Down Expand Up @@ -169,6 +161,15 @@ partition(Function,VisibleList,VisibleList) := HashTable => (f,s,i) -> (
-----------------------------------------------------------------------------
-- a first use of sets:

-- TODO: move these somewhere more appropriate
-- we've been waiting to do this:
binaryOperators = unique toList binaryOperators
prefixOperators = unique toList prefixOperators
postfixOperators = unique toList postfixOperators
flexibleOperators = unique toList flexibleOperators
fixedOperators = unique toList fixedOperators
allOperators = unique toList allOperators

protect Flexible
protect Binary
protect Prefix
Expand Down

0 comments on commit 89b45a7

Please sign in to comment.