Closed SamWheating closed 9 months ago
This PR enables the following operations:
S.difference(x)
S - x
S.intersection(x)
S & x
S.symmetric_difference(x)
S ^ x
S.issubset(x)
S <= x
s < x
S.issuperset(x) AKA S >= x or S > x
S.issuperset(x)
S >= x
S > x
I also unified the unified the implementations of these operations which were inlined in the evaluator with the implementation defined in values.go, to reduce duplication.
values.go
Demo:
Welcome to Starlark (go.starlark.net) >>> x = set([1,2,3]) >>> y = set([3,4,5]) >>> x.intersection(y) set([3]) >>> x.difference(y) set([1, 2]) >>> x.symmetric_difference(y) set([1, 2, 4, 5]) >>> x.issuperset(y) False >>> x.issuperset(set([1,2])) True >>> x.issubset(y) False >>> x.issubset(set([1,2,3,4])) True
This PR enables the following operations:
S.difference(x)
AKAS - x
S.intersection(x)
AKAS & x
S.symmetric_difference(x)
AKAS ^ x
S.issubset(x)
AKAS <= x
ors < x
S.issuperset(x)
AKAS >= x
orS > x
I also unified the unified the implementations of these operations which were inlined in the evaluator with the implementation defined in
values.go
, to reduce duplication.Demo: