From 625cf521907bed48c91eeebc59a763639610c611 Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Tue, 10 Oct 2023 10:37:20 -0400 Subject: [PATCH 1/2] extend RecursiveArrayTools.issymbollike for Num --- Project.toml | 1 + src/num.jl | 3 +++ test/overloads.jl | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 554929177..56c30e102 100644 --- a/Project.toml +++ b/Project.toml @@ -26,6 +26,7 @@ Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a" NaNMath = "77ba4419-2d1f-58cd-9bb1-8ffee604a2e3" PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a" RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" Reexport = "189a3867-3050-52da-a836-e630ba90ab69" Requires = "ae029012-a4dd-5104-9daa-d747884805df" RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47" diff --git a/src/num.jl b/src/num.jl index 5859ed606..6646e8e6e 100644 --- a/src/num.jl +++ b/src/num.jl @@ -197,3 +197,6 @@ function Base.Docs.getdoc(x::Num) end Markdown.parse(join(strings, "\n\n ")) end + +using RecursiveArrayTools +RecursiveArrayTools.issymbollike(::Union{BasicSymbolic,Num}) = true diff --git a/test/overloads.jl b/test/overloads.jl index 7218467e6..474218554 100644 --- a/test/overloads.jl +++ b/test/overloads.jl @@ -167,7 +167,7 @@ z2 = c + d * im @test sign(Num(1)) isa Num @test isequal(sign(Num(1)), Num(1)) @test isequal(sign(Num(-1)), Num(-1)) - + @test isequal(ℯ^a, exp(a)) using IfElse: ifelse @@ -237,3 +237,6 @@ for f in [<, <=, >, >=, isless] end @test_nowarn binomial(t, 1) + +using RecursiveArrayTools +@test RecursiveArrayTools.issymbollike(t) From 6f75be00c771ef777a20dc34baf4c61b450a71cf Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Tue, 10 Oct 2023 11:12:34 -0400 Subject: [PATCH 2/2] bound RecursiveArrayTools --- Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Project.toml b/Project.toml index 56c30e102..92516b8b4 100644 --- a/Project.toml +++ b/Project.toml @@ -64,6 +64,7 @@ MacroTools = "0.5" NaNMath = "0.3, 1" PrecompileTools = "1" RecipesBase = "1.1" +RecursiveArrayTools = "2" Reexport = "0.2, 1" ReferenceTests = "0.9" Requires = "1.1"