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

Proc macro updates #192

Closed
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@birkenfeld
Collaborator

birkenfeld commented May 28, 2017

This is based on #191, #181 and the use-lisp-fn branch.

@Wilfred

This comment has been minimized.

Owner

Wilfred commented May 28, 2017

Looks like this is just failing due to rustfmt, though I imagine we'll get the OS X failure once rustfmt is happy.

@Wilfred

Definitely more readable. 👍

@jeandudey

jeandudey approved these changes May 29, 2017 edited

Everything seems to be good!

I think you'll have some conflicts in src/lisp.rs because in #181 i removed the defun_many macro and you did that too. If you solve these conflicts let us know to merge the PR.

},
}
},
_ => return Err("lisp functions cannot have `self` arguments"),
}
}

This comment has been minimized.

@jeandudey

jeandudey May 29, 2017

Collaborator

💯, this looked like a mounstrosity. Thanks for doing this 😄

pub struct LispFnArgs {
/// Desired Lisp name of the function.
/// If not given, derived as the Rust name with "_" -> "-".

This comment has been minimized.

@jeandudey

jeandudey May 29, 2017

Collaborator

👍 Very ingenious

@birkenfeld

This comment has been minimized.

Collaborator

birkenfeld commented May 29, 2017

Thanks for the reviews! I'll rebase this onto master, then any conflicts should be gone.

@birkenfeld birkenfeld force-pushed the birkenfeld:proc_macro_updates branch from 0d6905a to 2075821 May 29, 2017

jeandudey and others added some commits May 22, 2017

Move the following Lisp functions to Rust:
* eql
* equal
* equal-including-properties
* delq
* car-safe
* cdr-safe
* memq
* memql
* member
* nthcdr
* nth
* assq
* assoc
* rassq
* rassoc
* plist-get
* plist-put
* lax-plist-put
* lax-plist-get
* plist-member
* string-equal
* markerp

Other changes:

* Create comparison methods for LispObject for each of the three
  ELisp ways (eq, eql, equal).
* Use the provided way to construct bools and t.
* Create a Rusty API for working with cons cells (as_cons() returns
  a newtype that has car() and cdr() methods).
* Introduce a list tails iterator to replace the FOR_EACH_TAIL and
  FOR_EACH_TAIL_SAFE macro.
* Add missing Cargo.lock for remacs-sys.
* Migrate XXXP() functions to LispObject::is_xxx() and remove unused ones.
* Avoid allocating a vector for each call to a MANY function.
* Fixup makefile targets to avoid "override" warnings.
Change `lisp_fn` proc macro slightly to allow less repeating.
* Lisp name is inferred from Rust name with underscore -> dash
* C name can be customized in the cases where Rust needs a special name
* Number of args is inferred from Rust. "min" only needs to be given
  if there are optional args.
* Less cloning.

@birkenfeld birkenfeld force-pushed the birkenfeld:proc_macro_updates branch from 2075821 to 8f41e07 May 30, 2017

@Wilfred

This comment has been minimized.

Owner

Wilfred commented Jun 3, 2017

@birkenfeld it's odd that the tests are still failing. I'll take a look. Would you mind pushing your old version of this branch somewhere? I'd like to bisect the various changes before they were squashed.

@birkenfeld

This comment has been minimized.

Collaborator

birkenfeld commented Jun 5, 2017

@Wilfred unfortunately I don't have that reflog with me currently. But it's still only Tramp, so your suggestion to disable the tests might be incomplete?

@birkenfeld

This comment has been minimized.

Collaborator

birkenfeld commented Jun 18, 2017

Merged via #203.

@birkenfeld birkenfeld closed this Jun 18, 2017

@birkenfeld birkenfeld deleted the birkenfeld:proc_macro_updates branch Jun 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment