-
Notifications
You must be signed in to change notification settings - Fork 212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding additional set builtins #506
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Thanks for contributing this feature, with docs and tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks again.
<a id='set·difference'></a> | ||
### set·difference | ||
|
||
`S.difference(y)` returns a new set into which have been inserted all the elements of set S which are not in y. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This phrasing nicely finesses both the question of content and of ordering.
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: