-
Notifications
You must be signed in to change notification settings - Fork 39
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
Implement LittleSet
(follow-up on #95)
#107
base: master
Are you sure you want to change the base?
Conversation
This overcomes the issue with Julia v1.6 not supporting replace for tuples and does a better job working around the opaque tuple variant
# `data` should not be directly accessed | ||
Base.propertynames(@nospecialize(x::LittleSet)) = () | ||
function Base.propertynames(@nospecialize(x::LittleSet), ::Symbol) |
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 is highly unusual and no other type in this package does this.
# `data` should not be directly accessed | ||
Base.propertynames(@nospecialize(x::LittleSet)) = () | ||
function Base.propertynames(@nospecialize(x::LittleSet), ::Symbol) | ||
throw(ArgumentError("LittleSet does not support public access to it's fields.")) |
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.
throw(ArgumentError("LittleSet does not support public access to it's fields.")) | |
throw(ArgumentError("LittleSet does not support public access to its fields.")) |
# `FrozenLittleSet{T, Tuple{Vararg{T}}}`), these methods allow accessing data without exposing the | ||
# underlying `data` field and unintentionally specializing downstream code on the exact type | ||
# representation of a tuple. | ||
if isdefined(Base, Symbol("@assume_effects")) |
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 doesn't work in Julia 1.6 (see CI failure). Perhaps this will?
if isdefined(Base, Symbol("@assume_effects")) | |
@static if isdefined(Base, Symbol("@assume_effects")) |
This is an updated go at #95 thats more feature complete and tests