-
Notifications
You must be signed in to change notification settings - Fork 309
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
Refactor EmacsDouble and LispNumber handling. #1565
base: master
Are you sure you want to change the base?
Conversation
@@ -260,25 +261,30 @@ pub enum ArithComparison { | |||
GrtrOrEqual, | |||
} | |||
|
|||
pub fn arithcompare(obj1: LispObject, obj2: LispObject, comparison: ArithComparison) -> bool { | |||
pub fn arithcompare( | |||
obj1: LispNumberOrFloatOrMarker, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe make these generic? impl Into<LispNumberOrFloatOrMarker
, or whatever the syntax is. That would get rid of casting at call sites.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, perhaps. Let me see how complex that is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the most common type is LispObject, I moved the more specific type into an internals function.
Co-Authored-By: Nick Drozd <nicholasdrozd@gmail.com>
Thanks @nickdrozd for looking. |
Trying to trigger a Travis build. |
This PR adds LispNumberOrMarker and refactors LispNumber to no
longer coerce markers.