diff --git a/Manifest.toml b/Manifest.toml index 3d1de9c..38c4bac 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -1,3 +1,5 @@ +# This file is machine-generated - editing it directly is not advised + [[Base64]] uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f" @@ -28,7 +30,7 @@ uuid = "b552c78f-8df3-52c6-915a-8e097449b14b" version = "0.0.7" [[Distributed]] -deps = ["LinearAlgebra", "Random", "Serialization", "Sockets"] +deps = ["Random", "Serialization", "Sockets"] uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b" [[InteractiveUtils]] diff --git a/src/types.jl b/src/types.jl index 0117d70..d4e64dd 100644 --- a/src/types.jl +++ b/src/types.jl @@ -20,10 +20,10 @@ struct Term end (f::Term)(xs...) = convert(Term, Expr(:call, f, xs...)) Base.convert(::Type{Term}, ex::Term) = ex -Base.convert(::Type{Term}, ex) = Term(traverse(ex)) -traverse(t::Term) = get(t) -traverse(ex::Expr) = Expr(ex.head, traverse.(ex.args)...) -traverse(x) = x +Base.convert(::Type{Term}, ex) = Term(traverse!(ex)) +traverse!(t::Term) = get(t) +traverse!(ex::Expr) = (@. ex.args = traverse!(ex.args); ex) +traverse!(x) = x Base.:(==)(a::Term, b::Term) = a.ex == b.ex Base.hash(t::Term, h::UInt) = hash(t.ex, hash(Term, h))