Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note: this PR contains breaking changes, so if merged we should at least change the minor version number before next release
When using this crate, I thought it was confusing that operators are used for symbolic arithmetic but doing the same for checking equality is non-symbolic (ast comparison). To actually check symbolic equality, you need to use
_eq(other)
, which looks weird compared to other symbolic inequality checks likele(other)
orgt(other)
. So in this PR I've renamed_eq
toeq
, the only cost of which is removing thePartialEq
trait impl from the concreteAst
types. Instead, I've added a new method toAst
calledast_eq(&self, other: &dyn Ast) -> bool
that does this check explicitly. I think this is less likely to be used accidentally than==
, for which the user probably wants symbolic equality anyway.Also, there were several functions for
Real
that take/return a fraction but use the term "real" (e.g.,from_real(i32, i32)
). I've renamed these to "rational".Also, for the new
from_rational
function (replacingfrom_real
), I changed the input types toi64
instead ofi32
, but the deprecated wrapper still usesi32
. This is to match the return type ofas_rational
(new name foras_real
but otherwise unchanged).For all of the function renames, I kept a shallow wrapper with the old name and just marked it as deprecated. So the renames aren't a breaking change, but removing the
PartialEq
impl is.