From f43dbdbb0bdd6946d8653f9169374b3b995576e4 Mon Sep 17 00:00:00 2001 From: Shashi Gowda Date: Mon, 30 Aug 2021 07:21:41 -0400 Subject: [PATCH 1/2] default issym -- also make it work on types for consistency --- src/TermInterface.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TermInterface.jl b/src/TermInterface.jl index f0505de..796d1a8 100644 --- a/src/TermInterface.jl +++ b/src/TermInterface.jl @@ -30,7 +30,8 @@ export symtype Returns `true` if `x` is a symbol. If true, `nameof` must be defined on `x` and must return a Symbol. """ -function issym end +issym(x) = issym(typeof(x)) +issym(x::Type{T}) where {T} = false export issym """ @@ -96,7 +97,7 @@ similarterm(x, head, args, symtype=nothing; metadata=nothing) = similarterm(x::Type{Expr}, head, args, symtype=nothing; metadata=nothing) = Expr(head, args...) function similarterm(x::Type{T}, head, args, symtype=nothing; metadata=nothing) where T - if !istree(T) head else head(args...) end + !istree(T) ? head : head(args...) end export similarterm From c7cec41c8b99ec2e00fa150e2ba684a370f218fc Mon Sep 17 00:00:00 2001 From: Shashi Gowda Date: Mon, 30 Aug 2021 07:22:24 -0400 Subject: [PATCH 2/2] bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index cc3dad6..b620452 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TermInterface" uuid = "8ea1fca8-c5ef-4a55-8b96-4e9afe9c9a3c" authors = ["Shashi Gowda ", "Alessandro Cheli "] -version = "0.1.7" +version = "0.1.8" [compat] julia = "1"