Commits

camlspotter committed e67dd85

cleanup

  • Participants
  • Parent commits 7145acc

Comments (0)

Files changed (3)

 OCAMLCFLAGS   += -annot -w Ae
 OCAMLOPTFLAGS   += -annot -w Ae
 
-OCAMLDEPFLAGS= -syntax camlp4o -package lwt,js_of_ocaml.syntax
-OCAMLPPFLAGS= -syntax camlp4o -package lwt,js_of_ocaml.syntax
+OCAMLDEPFLAGS= -syntax camlp4o -package lwt,js_of_ocaml.syntax,js_of_ocaml.deriving.syntax
+OCAMLPPFLAGS= -syntax camlp4o -package lwt,js_of_ocaml.syntax,js_of_ocaml.deriving.syntax
 
 MyOCamlJSProgram(name, files) =
-    OCAMLPACKS[] += lwt js_of_ocaml
+    # Strange workaround... there is no OMy package js_of_ocaml.deriving, but it is required
+    OCAML_PREINSTALLED_PACKS[] += js_of_ocaml.deriving
+    OCAMLPACKS[] += lwt js_of_ocaml js_of_ocaml.deriving
 
     public.OCAML_BYTE_LINK_FLAGS = -linkpkg # removes -custom
 

File chart2/chart.ml

 
    eval_string "function drawChart () { ... }"
 
-   has no error (I do not know what happens) but it is inaccessible.
+   has no effect after eval_string.
 *)
 
 let drawChart () = 
   let data = jsnew (google##visualization##_DataTable) () in
-  data##addColumn(Js.string "string", Js.string "Topping", Js.string "");
-  data##addColumn(Js.string "number", Js.string "Slices", Js.string "");
+  data##addColumn(Js.string "string", Js.string "Topping");
+  data##addColumn(Js.string "number", Js.string "Slices");
   let rows = [ ("Mushrooms", 3); 
                ("Onions", 1);
                ("Olives", 1); 
     Js.array [| Js.string name; 
                 (* No phantom for top type? *)
                 Obj.magic q |])  rows)));
+
   (* eval_string of JavaScript object literal fails *)
+  (* Someone has written a patch for a syntax sugar of Javascript object literal. So wait and see. *)
   let options = Unsafe.variable "{'title':'How Much Pizza I Ate Last Night', 'width':400, 'height':300}" in
+
   let divPie = match Opt.to_option (Dom_html.window##document##getElementById (Js.string "pie_chart_div")) with
     | None -> assert false
     | Some div -> div

File chart2/google.ml

 
 module DataTable = struct
   class type t = object
+    method addColumn_withID : js_string Js.t (* type. Either "string", "number", "boolean", "date", "datetime" or "timeofday" *)
+                              -> js_string Js.t (* label *)
+                              -> js_string Js.t (* id *)
+                              -> unit meth
+
     method addColumn : js_string Js.t (* type. Either "string", "number", "boolean", "date", "datetime" or "timeofday" *)
                        -> js_string Js.t (* label *)
-                       -> js_string Js.t (* id *)
                        -> unit meth
 
     method addRows : js_string Js.t js_array Js.t js_array Js.t -> unit meth