Hello everybody !
I want to construct product rings (fields) of modular integers. For example Z/5ZxZ/7Z
I began like this :
#http://nemocas.github.io/Nemo.jl/v0.6/types/#the-abstract-type-hierarchy-in-nemo
using Nemo
R5 = ResidueRing( ZZ , 5)
R7= ResidueRing( ZZ , 7)
struct Z_sur_5ZxZ_sur_7Z <:RingElem
c::Tuple{nmod, nmod}
end
const Z57=Z_sur_5ZxZ_sur_7Z #alias
Base.show(io::IO, C::Z57) = print(io,C.c)
couple(x::Int64,y::Int64)=Z57((R5(x),R7(y)))
println(couple(12,13))
zero(Z57)=couple(0,0) #neutre de l'addition
println(zero(Z57))
println(couple(5,7))
one(Z57)=couple(1,1)
println(one(Z57))
Base.:==(C1::Z57,C2::Z57)=(C1.c[1]==C2.c[1])&&(C1.c[2]==C2.c[2])
Everything is OK till the last instruction which gives me the error :
RROR: LoadError: syntax: type declarations on global variables are not yet supported
Stacktrace:
[1] top-level scope
@ ~/PycharmProjects/Nemo/src/Anneaux/RingProduct.jl:17
in expression starting at /home/gilles/PycharmProjects/Nemo/src/Anneaux/RingProduct.jl:17
If there’s no attempt to overload, for example with this code :
equality(C1::Z57,C2::Z57)=C1.c==C2.c
println(equality(couple(5,7),zero(Z57)))
Everything is OK, so the ‘global variable’ reference has nothing to do with the Z57 alias.
Somebody can explain ?
Thank you !
Gilles