From 55c9a87f0033b7c9f33a8b4fb60e9aa60021a972 Mon Sep 17 00:00:00 2001 From: ggsmith842 Date: Thu, 8 Aug 2024 13:51:58 -0600 Subject: [PATCH] add icon --- source/_posts/ocaml.md | 12 +++++++----- source/assets/icon/ocaml.svg | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 source/assets/icon/ocaml.svg diff --git a/source/_posts/ocaml.md b/source/_posts/ocaml.md index 7ab5969..7c157db 100644 --- a/source/_posts/ocaml.md +++ b/source/_posts/ocaml.md @@ -16,13 +16,14 @@ plugins: ## Getting Started ### hello.ml + ```ml let () = let message = "Hello, World!" in Printf.printf "%s\n" message ``` -Compile and Run +Compile and Run ```bash $ ocamlc -o hello.byte hello.ml @@ -30,12 +31,14 @@ $ ./hello.byte ``` Build and Run with Dune + ```bash $ dune build hello.exe $ _build/default/hello.exe ``` ### Comments + ```ml (* A single line comment *) @@ -45,6 +48,7 @@ $ _build/default/hello.exe ``` ### Expressions and Primitive Types + ```ml (* an expression *) 50 * 50 @@ -66,9 +70,8 @@ let untrue = false "a string" ``` - - ### Variables + ```ml (* data is immutable in ocaml *) let x = "a string" @@ -78,10 +81,9 @@ let z = [1;2;3] ``` ### Functions + ```ml let add_two_ints x y = let sum = x + y in sum ``` - - diff --git a/source/assets/icon/ocaml.svg b/source/assets/icon/ocaml.svg new file mode 100644 index 0000000..f29001c --- /dev/null +++ b/source/assets/icon/ocaml.svg @@ -0,0 +1 @@ + \ No newline at end of file