Permalink
Browse files

froc-direct example

  • Loading branch information...
1 parent 9d772fc commit c63edb4d1ffde291f37b469b1dc91adbe774df82 Jake Donham committed Sep 24, 2010
Showing with 34 additions and 0 deletions.
  1. +9 −0 examples/froc-direct/Makefile
  2. +2 −0 examples/froc-direct/_tags
  3. +23 −0 examples/froc-direct/direct.ml
@@ -0,0 +1,9 @@
+all: myocamlbuild.ml
+ ocamlbuild direct.byte direct.native
+
+clean:
+ ocamlbuild -clean
+ rm -f myocamlbuild.ml
+
+myocamlbuild.ml:
+ ln -s ../../tools/myocamlbuild.ml
@@ -0,0 +1,2 @@
+<*.ml*> : pkg_froc-direct
+<*.byte> or <*.native> : pkg_froc-direct
@@ -0,0 +1,23 @@
+open Froc_direct
+
+let (e1 : unit Froc.event), s1 = Froc.make_event ()
+let (e2 : unit Froc.event), s2 = Froc.make_event ()
+
+let b1 = Froc.count e1
+let b2 = Froc.count e2
+
+let b3 = ~|(fun () -> ~.b1 + ~.b2)
+(*
+let b3 =
+ Froc_direct.direct begin fun () ->
+ Froc_direct.read b1 + Froc_direct.read b2
+ end
+*)
+
+;;
+
+prerr_endline (string_of_int (Froc.sample b3));
+Froc.send s1 ();
+prerr_endline (string_of_int (Froc.sample b3));
+Froc.send s2 ();
+prerr_endline (string_of_int (Froc.sample b3));

0 comments on commit c63edb4

Please sign in to comment.