JuliaGeometry / JuliaGeometry/GeometryBasics.jl
Do not define `Base.in` instead of `Base.issubset` (taking set theory seriously)
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 215
- Forks
- 64
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 2
Description
The definition at
is not in the spirit of Base.in, and instead that procedure should be a method for Base.issubset (⊆).
see for example:
Base.in(a, b::AbstractInterval) = !(a ≫ b || a ≪ b)
function Base.in(a::AbstractInterval, b::AbstractInterval)
# Intervals should be compared with set operations
throw(ArgumentError("Intervals can not be compared with `in`. Use `issubset` instead."))
end
These operations are related, even graphically (∈ ⊂), but should not be mixed up.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at src/primitives/rectangles.jl lines 469-481 and compare the current Base.in definition with the referenced Intervals.jl implementation. Check Julia's Base.issubset and Base.in conventions, then update the rectangle operation so set containment uses issubset rather than in. Done means the API follows the issue's set-theoretic distinction and the existing behavior is covered by the relevant project tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- computer-graphics
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100