Skip to content
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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Conversation

Tokazama
Copy link
Member

@Tokazama Tokazama commented Aug 10, 2023

This is an updated go at #95 thats more feature complete and tests

@Tokazama Tokazama changed the title Follow-up on #95 Implement LittleSet (follow-up on #95) Aug 13, 2023
Tokazama and others added 3 commits August 12, 2023 23:14
This overcomes the issue with Julia v1.6 not supporting replace for
tuples and does a better job working around the opaque tuple variant
Comment on lines +61 to +63
# `data` should not be directly accessed
Base.propertynames(@nospecialize(x::LittleSet)) = ()
function Base.propertynames(@nospecialize(x::LittleSet), ::Symbol)
Copy link
Member

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."))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"))
Copy link
Member

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?

Suggested change
if isdefined(Base, Symbol("@assume_effects"))
@static if isdefined(Base, Symbol("@assume_effects"))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants