1. camlspotter
  2. chart

Commits

camlspotter  committed d6ba7bb

build depend

  • Participants
  • Parent commits 20dff84
  • Branches default

Comments (0)

Files changed (3)

File lib/std.mli

View file
  • Ignore whitespace
 
 val any : 'a t -> any t
 
-val int : int -> int_t
+external int : int -> int t = "%identity"
 
 val alert : string -> unit
   (** JS alert function *)

File test/OMakefile

View file
  • Ignore whitespace
+OCAMLCFLAGS   += -I ../lib
+OCAMLOPTFLAGS += -I ../lib
+
+# Enforce ../lib/xJs.cmo exists before compilation
+.SCANNER: scan-ocaml-%: ../lib/xJs.cmo
+%.cmx %.cmo %.cmi %.cma %.cmxa %.annot %.spot %.spit : ../lib/xJs.cmo
+
 FILES[] =
+    ../lib/xJs
     chart
 
-OCAML_PREINSTALLED_PACKS[] += xJs
-OCAMLPACKS[] += xJs
-
 MyOCamlJSProgram(chart, $(FILES))

File test/chart.ml

View file
  • Ignore whitespace
 open Js
 open XJs
-(* open Std *)
+open Std
 open Google
 open Lwt
 
   ignore begin
     Data.get "data.txt" >>= fun rows ->
     data##addRows(Js.array (Array.of_list (List.map (fun (x,y) -> 
-      Js.array [| Obj.magic x; Obj.magic y; |]) rows)));
+      Js.array [| int x; int y; |]) rows)));
     return ()
   end
 
     let rec iter = function
       | [] -> return ()
       | (x,y)::xys ->
-          data##addRows(Js.array [| Js.array [| Obj.magic x; Obj.magic y; |] |]);
+          data##addRows(Js.array [| Js.array [| int x; int y; |] |]);
           Lwt_js.sleep 0.2 >>= fun () ->
           iter xys (* It seems not to be executed.... Hmmm *)
     in