From 1c80158d5b15f597777d385374e7ffdc92870056 Mon Sep 17 00:00:00 2001 From: "Thomas A. Christensen II" <25492070+MillironX@users.noreply.github.com> Date: Tue, 1 Oct 2024 10:38:47 -0500 Subject: [PATCH] refactor: Add Base methods for generic Edit --- src/Edit.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Edit.jl b/src/Edit.jl index c9ac5e6..718db49 100644 --- a/src/Edit.jl +++ b/src/Edit.jl @@ -11,9 +11,10 @@ If insertion: Insertion of length L b/w ref pos `pos:pos+1` """ abstract type Edit{S<:BioSequence,T<:BioSymbol} end -Base.length(e::Edit) = length(_mutation(e)) -Base.:(==)(e1::Edit, e2::Edit) = e1.pos == e2.pos && e1.x == e2.x -Base.hash(x::Edit, h::UInt) = hash(Edit, hash((x.x, x.pos), h)) +Base.length(e::Edit) = error("length not implemented for type $(typeof(e))") +Base.:(==)(e1::Edit, e2::Edit) = typeof(e1) == typeof(e2) && e1 == e2 +Base.hash(x::Edit, h::UInt) = error("hash not implemented for type $(typeof(x))") + function Base.isless(x::Edit, y::Edit) if leftposition(x) == leftposition(y) return length(x) < length(y)