about summary refs log tree commit diff stats
path: root/modal/ocaml/examples
diff options
context:
space:
mode:
Diffstat (limited to 'modal/ocaml/examples')
-rw-r--r--modal/ocaml/examples/arith.modal13
-rw-r--r--modal/ocaml/examples/devices.modal6
-rw-r--r--modal/ocaml/examples/dynamic_rules.modal5
-rw-r--r--modal/ocaml/examples/logic.modal6
-rw-r--r--modal/ocaml/examples/print_and_list.modal5
5 files changed, 35 insertions, 0 deletions
diff --git a/modal/ocaml/examples/arith.modal b/modal/ocaml/examples/arith.modal
new file mode 100644
index 0000000..2193724
--- /dev/null
+++ b/modal/ocaml/examples/arith.modal
@@ -0,0 +1,13 @@
+.. (?: + 10 2)
+.. (?: - 10 2)
+.. (?: * 6 7)
+.. (?: / 21 3)
+.. (?: % 21 5)
+.. (?: & 6 3)
+.. (?: ^ 6 3)
+.. (?: | 6 1)
+.. (?: = 5 5)
+.. (?: ! 5 6)
+.. (?: > 9 2)
+.. (?: < 2 9)
+
diff --git a/modal/ocaml/examples/devices.modal b/modal/ocaml/examples/devices.modal
new file mode 100644
index 0000000..82f5a4e
--- /dev/null
+++ b/modal/ocaml/examples/devices.modal
@@ -0,0 +1,6 @@
+.. (?: Hello)
+.. (?: + 1 2 3)
+.. (?^ (a (b c)))
+.. (?. (a (b)))
+.. (?* abc)
+
diff --git a/modal/ocaml/examples/dynamic_rules.modal b/modal/ocaml/examples/dynamic_rules.modal
new file mode 100644
index 0000000..7e17f76
--- /dev/null
+++ b/modal/ocaml/examples/dynamic_rules.modal
@@ -0,0 +1,5 @@
+.. ((eq fox bat) (eq bat bat))
+.. ((<>) (eq ?x ?x) (#t))
+.. ((<>) (eq ?x ?y) (#f))
+.. (>< (eq ?x ?y) (#f))
+
diff --git a/modal/ocaml/examples/logic.modal b/modal/ocaml/examples/logic.modal
new file mode 100644
index 0000000..ec94b55
--- /dev/null
+++ b/modal/ocaml/examples/logic.modal
@@ -0,0 +1,6 @@
+<> (eq ?x ?x) (#t)
+<> (eq ?x ?y) (#f)
+
+.. (eq fox bat)
+.. (eq bat bat)
+
diff --git a/modal/ocaml/examples/print_and_list.modal b/modal/ocaml/examples/print_and_list.modal
new file mode 100644
index 0000000..3de51cb
--- /dev/null
+++ b/modal/ocaml/examples/print_and_list.modal
@@ -0,0 +1,5 @@
+<> (print List (?: ?x)) (print List ?x)
+<> (print List ()) ()
+
+.. (print List (h (e (l (l (o ()))))))
+