Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extend RecursiveArrayTools.issymbollike for Num #997

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And add a lower bound

Copy link
Contributor Author

@oscardssmith oscardssmith Oct 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it doesn't need one. This overload is valid for old versions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It still needs one in order to get registered 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done.

Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
Expand Down Expand Up @@ -63,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"
Expand Down
3 changes: 3 additions & 0 deletions src/num.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
5 changes: 4 additions & 1 deletion test/overloads.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -237,3 +237,6 @@ for f in [<, <=, >, >=, isless]
end

@test_nowarn binomial(t, 1)

using RecursiveArrayTools
@test RecursiveArrayTools.issymbollike(t)
Loading