Skip to content

Commit 8780e57

Browse files
committed
ocaml example1
1 parent cdf9494 commit 8780e57

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ocaml/Readme.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
OCaml
2+
-----
3+
4+
This is a really small demo that [OCaml](http://ocaml.org/) works.
5+
6+
In the terminal, just issue `ocaml example1.ml` and you should see the 10th Fibonaccy number.

ocaml/compile.term

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3453371b-2d7e-4f1c-a9f4-751d33a504fb

ocaml/example1.ml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
(* Fibonacci function *)
2+
3+
let rec fib n =
4+
if n < 2 then 1 else fib (n - 1) + fib (n - 2)
5+
;;
6+
7+
print_int (fib ( 10 ));
8+
print_newline();

0 commit comments

Comments
 (0)