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

Don't export ∞ #270

Closed
dlfivefifty opened this issue Mar 15, 2019 · 8 comments · Fixed by #570
Closed

Don't export ∞ #270

dlfivefifty opened this issue Mar 15, 2019 · 8 comments · Fixed by #570
Labels
1.0 Planned for the major 1.0 release

Comments

@dlfivefifty
Copy link
Contributor

InfiniteArrays.jl has as a special type, which conflicts with the exporting of from this package. I think the best solution is to not export from here, as there already exists Inf and the definition is not directly related to interval arithmetic.

@dpsanders
Copy link
Member

Thanks for the report. That's a good point.
I guess we should unexport then. Is there a simple way of importing it again? I guess we could just make a submodule called IntervalArithmetic.SpecialSymbols or similar.

Isn't there also a clash of .. with one of your packages? It also clashes with IntervalSets, which is used e.g. in Makie. I'm not sure what the general solution for such situations is.

@dlfivefifty
Copy link
Contributor Author

I use IntervalSets.jl, so yes that would also be good to coordinate. I don't know a good solution other than type piracy, which maybe is OK.

@dpsanders
Copy link
Member

I think a solution to this is to make a submodule IntervalArithmetic.Symbols or IntervalArithmetic.Special (or whatever) that exports and .., and not export them by default, even though that will be a pain.

Any thoughts @lbenet ?

@Kolaru
Copy link
Collaborator

Kolaru commented Apr 15, 2019

I think that can be moved to a submodule of symbols for IntervalArithmetic.jl.

A true solution to that would be to have a common that is more special that Inf currently is, such that it means different things depending on the context. In particular it should be usable as an index for InfiniteArrays.jl and be considered a Float in IntervalArithmetic.jl (I don't know if there are other use cases). However I'm not sure about the feasibility of this.

IntervalSets.jl and IntervalArithmetic.jl seem to be mutually exclusive, so users should probably use explicit import statement rather than using. A possibility to still have it is to allow setting ENV["IA_EXPORT_SYMBOLS"] to false before building the package and not exporting additional symbols like or .. in that case.

@lbenet
Copy link
Member

lbenet commented Apr 15, 2019

I think we can simply have unexported; speaking for myself, this is a symbol I don't use too often.

However, we should have .. at disposition, because it is incredibly handy; same for ±. So at the moment, I wouldn't do anything on them. As @dlfivefifty says, and is encouraged here, for the time being we could live with some type piracy.

@dlfivefifty
Copy link
Contributor Author

IntervalSets.jl README is actually suggesting that a..b still return an IntervalSets.ClosedInterval, and that IntervalArithmetic.jl does type piracy by overloading +, -, sin, etc.

@dpsanders
Copy link
Member

cc @yashrajgupta

@petvana
Copy link
Contributor

petvana commented May 30, 2022

Related proposal JuliaLang/julia#45475

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

Successfully merging a pull request may close this issue.

6 participants