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

impl From<(S, T)> for LispObject #1213

Merged
merged 1 commit into from Jan 5, 2019
Merged

Conversation

nickdrozd
Copy link
Collaborator

Calls to LispObject::cons would look cleaner if they were just
tuples. We can have the compiler do the conversions for us. This makes
the code a little Lispier.

Note that the conversion works recursively, so nested pairs don't need
to be handled as a special case.

Calls to LispObject::cons would look cleaner if they were just
tuples. We can have the compiler do the conversions for us. This makes
the code a little Lispier.

Note that the conversion works recursively, so nested pairs don't need
to be handled as a special case.
Copy link
Collaborator

@db48x db48x left a comment

Choose a reason for hiding this comment

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

fun idea :)

Copy link
Collaborator

@shaleh shaleh left a comment

Choose a reason for hiding this comment

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

Fun. I think I might have preferred a cons! macro so it looked a little less magical. But that is bikeshedding.

@nickdrozd
Copy link
Collaborator Author

Whenever I learn a cool new programming technique, I try to use it as much as possible. Currently that technique for me is generics. (After years of being on the side of dynamic types, I'm trying to give static typing a shot.)

@shaleh
Copy link
Collaborator

shaleh commented Jan 5, 2019

Just remember code is read as much as it is executed. If we make it too hard to understand it can make it more difficult to bring in new coders. Plus, if we put the code down for a bit it can become foreign even to ourself.

@nickdrozd
Copy link
Collaborator Author

That's a good point. I think as far as legibility goes, there are two groups of people who are interested in Remacs, people who want to learn Emacs internals and people who want to mess with Rust. This change pushes some of the complexity out of the Lispier parts of the code and into the Rustier parts. Hopefully this will satisfy both groups: the Emacs internals people don't want to deal with the more draconian parts of Rust, while the Rust people might enjoy seeing more powerful parts of the language used.

@nickdrozd nickdrozd merged commit 6f4ac71 into remacs:master Jan 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants