Skip to content

Commit fcd6b52

Browse files
committed
refactor: remove mutability from BasicSymbolic types
1 parent 045a0e7 commit fcd6b52

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/types.jl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,39 +23,39 @@ const EMPTY_DICT_T = typeof(EMPTY_DICT)
2323
const ENABLE_HASHCONSING = Ref(true)
2424

2525
@compactify show_methods=false begin
26-
@abstract mutable struct BasicSymbolic{T} <: Symbolic{T}
26+
@abstract struct BasicSymbolic{T} <: Symbolic{T}
2727
metadata::Metadata = NO_METADATA
2828
end
29-
mutable struct Sym{T} <: BasicSymbolic{T}
29+
struct Sym{T} <: BasicSymbolic{T}
3030
name::Symbol = :OOF
3131
end
32-
mutable struct Term{T} <: BasicSymbolic{T}
32+
struct Term{T} <: BasicSymbolic{T}
3333
f::Any = identity # base/num if Pow; issorted if Add/Dict
3434
arguments::Vector{Any} = EMPTY_ARGS
3535
hash::RefValue{UInt} = EMPTY_HASH
3636
hash2::RefValue{UInt} = EMPTY_HASH
3737
end
38-
mutable struct Mul{T} <: BasicSymbolic{T}
38+
struct Mul{T} <: BasicSymbolic{T}
3939
coeff::Any = 0 # exp/den if Pow
4040
dict::EMPTY_DICT_T = EMPTY_DICT
4141
hash::RefValue{UInt} = EMPTY_HASH
4242
hash2::RefValue{UInt} = EMPTY_HASH
4343
arguments::Vector{Any} = EMPTY_ARGS
4444
end
45-
mutable struct Add{T} <: BasicSymbolic{T}
45+
struct Add{T} <: BasicSymbolic{T}
4646
coeff::Any = 0 # exp/den if Pow
4747
dict::EMPTY_DICT_T = EMPTY_DICT
4848
hash::RefValue{UInt} = EMPTY_HASH
4949
hash2::RefValue{UInt} = EMPTY_HASH
5050
arguments::Vector{Any} = EMPTY_ARGS
5151
end
52-
mutable struct Div{T} <: BasicSymbolic{T}
52+
struct Div{T} <: BasicSymbolic{T}
5353
num::Any = 1
5454
den::Any = 1
5555
simplified::Bool = false
5656
arguments::Vector{Any} = EMPTY_ARGS
5757
end
58-
mutable struct Pow{T} <: BasicSymbolic{T}
58+
struct Pow{T} <: BasicSymbolic{T}
5959
base::Any = 1
6060
exp::Any = 1
6161
arguments::Vector{Any} = EMPTY_ARGS

0 commit comments

Comments
 (0)