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

Manual describes deprecated inner constructor syntax #20877

Closed
nalimilan opened this issue Mar 3, 2017 · 9 comments
Closed

Manual describes deprecated inner constructor syntax #20877

nalimilan opened this issue Mar 3, 2017 · 9 comments
Labels
docs This change adds or pertains to documentation
Milestone

Comments

@nalimilan
Copy link
Member

The section of the manual about constructors currently recommends a syntax which prints a deprecation warning. Worse, there's no mention of the correct syntax when one needs type parameters.

julia> immutable Rational{T<:Integer} <: Real
           num::T
           den::T

           function Rational(num::T, den::T)
               if num == 0 && den == 0
                   error("invalid rational: 0//0")
               end
               g = gcd(den, num)
               num = div(num, g)
               den = div(den, g)
               new(num, den)
           end
       end

WARNING: deprecated syntax "inner constructor Rational(...) around REPL[9]:6".
Use "Rational{T}(...) where T" instead.

BTW, it would be useful to document a solution which also works on 0.5 somewhere. Maybe in Compat? Cf. JuliaLang/Compat.jl#332.

@nalimilan nalimilan added the docs This change adds or pertains to documentation label Mar 3, 2017
@garrison
Copy link
Member

I suggest this ought to be added to the 0.6.0 milestone.

@JeffBezanson
Copy link
Member

The text on that page doesn't match what's currently in the source tree: https://github.com/JuliaLang/julia/blob/762c6db94092e70cc489a348186bd3760b2df545/doc/src/manual/constructors.md#case-study-rational
I definitely updated the manual for this.

@JeffBezanson JeffBezanson added this to the 0.6.0 milestone Apr 20, 2017
@yuyichao
Copy link
Contributor

The RTD version is not used anymore. The correct version is this. https://docs.julialang.org/en/latest/manual/constructors.html#Case-Study:-Rational-1

@JeffBezanson
Copy link
Member

It would be nice to have a link so you can select a released version or the development version.

@yuyichao
Copy link
Contributor

The new doc does have that function. I have no idea if we can link it the other way around/where do people get the link to the out of date RTD link though....

@dpsanders
Copy link
Contributor

Googling "julia docs" gives https://docs.julialang.org/
This redirects to the stable version.

@nalimilan
Copy link
Member Author

Should we just remove the Read the Docs pages then?

@StefanKarpinski
Copy link
Member

I made http://julia.readthedocs.io/en/latest/ no longer active, which means it's permission denied. Maybe that's good enough?

@nalimilan
Copy link
Member Author

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs This change adds or pertains to documentation
Projects
None yet
Development

No branches or pull requests

6 participants