Skip to content

Commit f439776

Browse files
committed
simplify issymbollike
1 parent 0965fc1 commit f439776

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

src/vector_of_array.jl

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,10 @@ end
6464
struct AllObserved
6565
end
6666

67-
Base.@pure __parameterless_type(T) = Base.typename(T).wrapper
68-
69-
@generated function issymbollike(x)
70-
x <: Union{Symbol, AllObserved} && return quote true end
71-
ss = ["Operation", "Variable", "Sym", "Num", "Term"]
72-
s = string(Symbol(__parameterless_type(x)))
73-
bool = any(x -> occursin(x, s), ss)
74-
quote
75-
$bool
76-
end
67+
function issymbollike(x)
68+
x isa Union{Symbol, AllObserved} && return true
69+
ss = (:Operation, :Variable, :Sym, :Num, :Term)
70+
return typeof(x).name.name in ss
7771
end
7872

7973
function Base.Array(VA::AbstractVectorOfArray{T, N, A}) where {T, N,

0 commit comments

Comments
 (0)