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
Usability in utop: must manually load various stuff before using the ppx #1
Comments
Note: you shouldn't have to require ppx_sexp_conv can probably require sexplib. I'm not sure what to do about the |
Without requiring
|
Not sure what's happening. @whitequark, any idea why we need to load ppx_deriving first? |
Try
|
Now if you
|
@diml oh, I see. Note how e.g. ppx_core supplies the |
I see, my bad. I'll add the dependency. Actually that's a problem I had while creating the packages and wanted to come back to: ppx_core (and a few other packages) are general purpose libraries that are not related to ppx_deriving or ppx_type_conv, so they should have a META file similar to any library. However there is currently no way to specify a dependency from a ppx_deriving plugin to a normal library. For instance I can't write a ppx_deriving plugin that would use pcre. |
That's a very good point. I think ppx_deriving should use findlib to discover the package archives. I think I used to link findlib before? I don't remember what made me switch to pure-dynlink. |
Yeah I think it would be easier if ppx_deriving was using findlib |
This is a still a bit frustrating. You have to load ppx_deriving first. If you load ppx_sexp_conv first, there's no way out except to restart utop. utop # #require "ppx_sexp_conv";;
utop # type t = int [@@deriving sexp];;
Cannot locate deriver sexp
(* Now you google for this error and end up here. You realize you need to load ppx_deriving, so you try it. *)
#require "ppx_deriving";;
utop # type t = int [@@deriving sexp];;
Cannot locate deriver sexp
utop # #require "ppx_deriving";;
utop # #require "ppx_sexp_conv";;
utop # type t = int [@@deriving sexp];;
Cannot locate deriver sexp Finally, restart utop and do the last sequence, and then it works. |
Yeah, unfortunately I haven't had time yet to fix that. |
This is fixed with ppx_sexp_conv 113.24.00 |
Ok, thanks! |
Hi,
I think this is more a kind of "usability bug": in order to make the following declaration work in utop "
type t = int * int [@@deriving sexp];;
", I figured out by trial and error that I had to first, in this order:The
open Sexplib.Conv
bit being the most puzzling imo (without it it complains thatint_of_sexp
is unbound). Could this be shortened/documented a bit? I my head, a#require "ppx_deriving";; #require "ppx_sexp_conv";;
should be sufficient...?Cheers,
Armaël
The text was updated successfully, but these errors were encountered: