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

Improve the syntax of ppx rewriters and flags #910

Merged
1 commit merged into from Jun 25, 2018
Merged

Improve the syntax of ppx rewriters and flags #910

1 commit merged into from Jun 25, 2018

Conversation

ghost
Copy link

@ghost ghost commented Jun 22, 2018

I never really liked the current syntax. This PR improves the syntax of (pps ...) as follow:

  • old syntax: (pps (ppx1 -arg1 ppx2 (-foo x)))
  • new syntax: (pps ppx1 -arg ppx2 -- -foo x)

@ghost ghost requested a review from rgrinberg June 22, 2018 11:33
- old syntax: (pps (ppx1 -arg1 ppx2 (-foo x)))
- new syntax: (pps ppx1 -arg ppx2 -- -foo x)

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
@rgrinberg
Copy link
Member

I'm not such a fan of using the special -- syntax here tbh. -- looks like something that will be passed as a literal argument which isn't really the case here.

Also, did the following work before:

(pps (ppx1 (-foo x) ppx2 -arg22))

If it did, how would it get translated?

@ghost
Copy link
Author

ghost commented Jun 23, 2018

It worked and translates to: (pps ppx1 ppx2 -- -foo x -arg22). Regarding the use of --, I see your point but it still looks like an improvement to me compared to the current syntax.

Copy link
Member

@rgrinberg rgrinberg left a comment

Choose a reason for hiding this comment

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

Yeah, I agree this is an improvement. I suppose that to be fully explicit we'd need something like a separate args fields for the pps constructor. This might seem like a heavy approach but I think it could pay off for customizing the :standard set of flags vs the :standard set of pp's via the env stanza.

@ghost ghost merged commit 0eb3022 into ocaml:master Jun 25, 2018
This pull request was closed.
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.

2 participants