-
Notifications
You must be signed in to change notification settings - Fork 17
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
Switch to ppx #5
Comments
Why not directly use |
Regarding internal use of camlp4, I've started a branch in which |
On Sun, Jul 19, 2015 at 10:32:50AM -0700, Simon Cruanes wrote:
Does ppx have access to the "x" in {x| ... |x} ? sqlc will be a bit trickier since it's built on estring's (register_shared_expr)
becomes
As for the backward-compatible stuff, does it seem doable?
(doh' at issue title typo)Mauricio Fernández |
On Sun, Jul 19, 2015 at 10:34:34AM -0700, Simon Cruanes wrote:
I was going to write that ocaml-sqlexpr should be desugared altogether, but on In fact, keeping the lib as is (i.e., using camlp4) gives a small Mauricio Fernández |
Several people made the good point that
Yes
Not without a lot of pain and corner cases. |
in many cases, then, |
Here is a patch set adding ppx support, comments welcome: #6 The patch set uses the |
Looks like this could be closed, since #6 was merged? |
camlp4 is on the way out, ppx is becoming increasingly popular, and using both at once can be problematic (camlp4 doesn't recognize newer ppx syntax)...
What should the syntax look like, though? Does something like this make sense (I haven't worked with ppx yet...):
[%sql {s| select @s{login}, @s{password} FROM users WHERE id = %s|s}]
, which would be expanded the same way as sql"..." with the current camlp4 extension (also[%sqlc ...]
and[%sqlinit ...]
forms, plussql_check"..."
)sql"..."
,sqlc"..."
,sqlinit"..."
andsqlcheck"..."
forms and expand (providing source compatibility), maybe (de)activated with switch(2)'s appeal is that, as far as ocaml-sqlexpr is concerned, the same source code could be compiled with both the ppx and the camlp4 extensions (so the user would be able to choose based on the other extensions in use). In fact, both
sqlexpr.ppx
andsqlexpr.syntax
could be maintained in the same tree and installed at once.The text was updated successfully, but these errors were encountered: