iocaml icon indicating copy to clipboard operation
iocaml copied to clipboard

PPX in iocaml

Open hcarty opened this issue 9 years ago • 1 comments

Extension points and attributes do not seem to work properly from a non-JS iocaml environment. For example:

#use "topfind"
#require "ppx_deriving_yojson"
type t = {
  x : int;
  y : int;
} [@@deriving yojson]

Those cells don't end up defining the expected to_yojson/of_yojson functions.

This is with the latest from opam as of April 14, 2016.

hcarty avatar Apr 15 '16 13:04 hcarty

The kernel needs to run Pparse.apply_rewriters. I've tried to add it, but it causes strange crashes elsewhere after a ppx is enabled. Will need to have a closer look into why this is happening.

andrewray avatar Apr 15 '16 17:04 andrewray