Nemocas / AbstractAlgebra.jl

Generic abstract algebra functionality in pure Julia (no C dependencies)
https://nemocas.github.io/AbstractAlgebra.jl/dev/index.html
Other
163 stars 63 forks source link

Ring interface example is not working #1742

Closed SoongNoonien closed 2 months ago

SoongNoonien commented 3 months ago

Hi! While implementing a custom ring interface I had minor problems getting it to work. Specifically there was a method for base_ring_type missing. But then I noticed that this also effects the minimal example from the wiki. This is the error I get when using the minimal example:

julia> ConstantPolynomialRing(ZZ)
Constant polynomials over Error showing value of type ConstPolyRing{BigInt}:
ERROR: MethodError: no method matching base_ring_type(::ConstPolyRing{BigInt})

Closest candidates are:
  base_ring_type(::Type{ConstPoly{T}}) where T<:RingElement
   @ Main REPL[12]:1

Stacktrace:
 [1] base_ring(R::ConstPolyRing{BigInt})
   @ Main ./REPL[13]:1
 [2] show(io::IOContext{Base.TTY}, R::ConstPolyRing{BigInt})
   @ Main ./REPL[26]:3
 [3] show(io::IOContext{Base.TTY}, ::MIME{Symbol("text/plain")}, x::ConstPolyRing{BigInt})
   @ Base.Multimedia ./multimedia.jl:47
fingolfin commented 3 months ago

Yes ring types now must implement base_ring_type. The example in the manual you link to (BTW that's not a Wiki!) needs to be updated accordingly.

SoongNoonien commented 3 months ago

BTW that's not a Wiki!

Of course, sorry, I miss typed...