2016-12-27 11 views
1

これは私のocamlinitです:ppxが動作するようにocamlinitを設定するにはどうすればよいですか?

これにより
(* Added by OPAM. *) 
let() = 
    try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") 
    with Not_found ->() 
;; 

(* ## added by OPAM user-setup for ocamltop/base ## 3ec62baf6f9c219ae06d9814069da862 ## you can edit, but keep this line *) 

#use "topfind";; 
(* ## end of OPAM user-setup addition for ocamltop/base ## keep this line *) 

#thread;; 

(* #ppx "ppx-jane -as-ppx";; *) 
#require "ppx_jane";; 
#require "core.top";; 
#require "async";; 
#require "core_extended";; 


open Core.Std;; 

はまさに、私が#ppxの代わり#require "ppx_jane"で始まる行を使用している場合は、私はこのエラー

utop # type test = char list [@@deriving show];; 
Error: ppx_type_conv: 'show' is not a supported type type-conv generator 
を取得

utop # type test = char list [@@deriving show];; 
Error: Cannot locate deriver show 

utopでこれを取得します

ocamlinitを[@@deriving show]に設定するにはどうすればよいですか?

答えて

1

#require "ppx_deriving.show";;#require "ppx_jane";;の有無にかかわらず)を使用して作業することができました。

+0

私の完全なocamlinitです。 – ackerleytng

0

ピエールの提案に加えて、私はの行がppx_janeであることが必要であることを発見しました。

また、ppx_deriving.showの代わりに#require "ppx_deriving.std"を使用してordと残りのものも使用しました。 deriving.show`を:

は、ここで私はことを試みたが、私は `そのようなパッケージを持っていない

(* Added by OPAM. *) 
let() = 
    try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") 
    with Not_found ->() 
;; 

(* ## added by OPAM user-setup for ocamltop/base ## 3ec62baf6f9c219ae06d9814069da862 ## you can edit, but keep this line *) 
#use "topfind";; 
(* ## end of OPAM user-setup addition for ocamltop/base ## keep this line *) 

#thread;; 

#require "ppx_jane";; 
#require "core.top";; 
#require "async";; 
#require "core_extended";; 

#require "ppx_deriving.std";; 

open Core.Std;; 
+0

ああ!それはまだemacs utopでは動作しません。私がC-c C-bをするとき、utopはあたかもそこにいないかのように[@@ deriving show]を扱うようです。 – ackerleytng

+0

しかし、私が各コマンドでC-x C-eを個別に実行すると、utopはすべての点で問題ないようです。 – ackerleytng

関連する問題