Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

froc-direct example

  • Loading branch information...
commit c63edb4d1ffde291f37b469b1dc91adbe774df82 1 parent 9d772fc
Jake Donham authored
View
9 examples/froc-direct/Makefile
@@ -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
View
2  examples/froc-direct/_tags
@@ -0,0 +1,2 @@
+<*.ml*> : pkg_froc-direct
+<*.byte> or <*.native> : pkg_froc-direct
View
23 examples/froc-direct/direct.ml
@@ -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));
Please sign in to comment.
Something went wrong with that request. Please try again.