prevent adding methods to the functions > and >=#4065
prevent adding methods to the functions > and >=#4065odow merged 4 commits intojump-dev:masterfrom nsajko:prevent_adding_methods_fix
> and >=#4065Conversation
As documented, the intended way to implement `>` is to add a method to `<`. Similarly with `>=`. A package should never add a method to either `>` or `>=`.
Correct error message for variable comparison in Julia.
Correct error messages in nonlinear.md for clarity.
|
|
||
| julia> f(x) | ||
| ERROR: Cannot evaluate `>` between a variable and a number. | ||
| ERROR: Cannot evaluate `<` between a variable and a number. |
There was a problem hiding this comment.
This is the only downside. We might talk about < when the user wrote >.
|
Aside from recommended practice, what is the motivation for this? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4065 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 43 43
Lines 6201 6201
=========================================
Hits 6201 6201 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR, together with PR JuliaDiff/ForwardDiff.jl#771, greatly decreases the amount of sysimage invalidation on
EDIT: the above is with nightly (v1.13) Julia, JuliaLang/julia@865b8be |
|
Status with this PR, but without PR JuliaDiff/ForwardDiff.jl#771:
So an improvement, but not as much as with PR JuliaDiff/ForwardDiff.jl#771. |
|
NB: if you want to reproduce the above results, do |
|
Invalidation is a good reason |
As documented, the intended way to implement
>is to add a method to<. Similarly with>=. A package should never add a method to either>or>=.