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

Refactor EmacsDouble and LispNumber handling. #1565

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

shaleh
Copy link
Collaborator

@shaleh shaleh commented Feb 24, 2020

This PR adds LispNumberOrMarker and refactors LispNumber to no
longer coerce markers.

rust_src/src/floatfns.rs Outdated Show resolved Hide resolved
@@ -260,25 +261,30 @@ pub enum ArithComparison {
GrtrOrEqual,
}

pub fn arithcompare(obj1: LispObject, obj2: LispObject, comparison: ArithComparison) -> bool {
pub fn arithcompare(
obj1: LispNumberOrFloatOrMarker,
Copy link
Collaborator

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.

Copy link
Collaborator Author

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.

Copy link
Collaborator Author

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.

@shaleh
Copy link
Collaborator Author

shaleh commented Feb 25, 2020

Thanks @nickdrozd for looking.

@shaleh
Copy link
Collaborator Author

shaleh commented Feb 26, 2020

Trying to trigger a Travis build.

@shaleh shaleh closed this Feb 26, 2020
@shaleh shaleh reopened this Feb 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants