diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 10b3bc5..87ed518 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -4,16 +4,16 @@ # ############################################################################### -immutable AutSymbol <: GSymbol +@compat struct AutSymbol <: GSymbol str::String pow::Int ex::Expr func::Function end -typealias AutGroupElem GWord{AutSymbol} +@compat AutGroupElem = GWord{AutSymbol} -type AutGroup <: AbstractFPGroup +@compat mutable struct AutGroup <: AbstractFPGroup objectGroup::Group gens::Vector{AutSymbol} end diff --git a/src/FPGroups.jl b/src/FPGroups.jl index 4ab27c8..6705329 100644 --- a/src/FPGroups.jl +++ b/src/FPGroups.jl @@ -4,14 +4,14 @@ # ############################################################################### -immutable FPSymbol <: GSymbol +@compat struct FPSymbol <: GSymbol str::String pow::Int end -typealias FPGroupElem = GWord{FPSymbol} +@compat FPGroupElem = GWord{FPSymbol} -type FPGroup <: AbstractFPGroup +@compat mutable struct FPGroup <: AbstractFPGroup gens::Vector{FPSymbol} rels::Dict{FPGroupElem, FPGroupElem} diff --git a/src/FreeGroup.jl b/src/FreeGroup.jl index a023395..7fd9fff 100644 --- a/src/FreeGroup.jl +++ b/src/FreeGroup.jl @@ -4,14 +4,14 @@ # ############################################################################### -immutable FreeSymbol <: GSymbol +@compat struct FreeSymbol <: GSymbol str::String pow::Int end -typealias FreeGroupElem GWord{FreeSymbol} +@compat FreeGroupElem = GWord{FreeSymbol} -type FreeGroup <: AbstractFPGroup +@compat mutable struct FreeGroup <: AbstractFPGroup gens::Vector{FreeSymbol} # order::Vector{T} # fastmult_table::Array{Int,2} diff --git a/src/Groups.jl b/src/Groups.jl index dfb027e..a4ae24d 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -1,4 +1,5 @@ module Groups +using Compat using Nemo import Nemo: Group, GroupElem, Ring @@ -24,7 +25,7 @@ doc""" > * `pow` which is the (multiplicative) exponent of a symbol. """ -abstract GSymbol +abstract type GSymbol end doc""" W::GWord{T<:GSymbol} <:GroupElem @@ -42,7 +43,7 @@ doc""" """ -type GWord{T<:GSymbol} <: GroupElem +@compat mutable struct GWord{T<:GSymbol} <: GroupElem symbols::Vector{T} savedhash::UInt modified::Bool @@ -78,11 +79,11 @@ convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s]) # ############################################################################### -xor(a,b) = a $ b function hash(W::GWord, h::UInt) W.modified && reduce!(W) - return xor(W.savedhash, h) + @compat res = xor(W.savedhash, h) + return res end function deepcopy_internal{T<:GSymbol}(W::GWord{T}, dict::ObjectIdDict)