aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorBad Diode <bd@badd10de.dev>2021-10-09 12:54:15 +0200
committerBad Diode <bd@badd10de.dev>2021-10-09 12:54:15 +0200
commitfbfce55d3c7e5d0b71661b3f1ff9674fba6b8618 (patch)
tree58b0b1a86a00e7597bc0f84f5ca6e215adee1232 /examples
parent2c601e7a00d54181bb67b403e79ca351eae200e2 (diff)
downloadbdl-fbfce55d3c7e5d0b71661b3f1ff9674fba6b8618.tar.gz
bdl-fbfce55d3c7e5d0b71661b3f1ff9674fba6b8618.zip
Add support for file interpretaion or repl
Diffstat (limited to 'examples')
-rw-r--r--examples/arithmetic.bdl22
1 files changed, 22 insertions, 0 deletions
diff --git a/examples/arithmetic.bdl b/examples/arithmetic.bdl
new file mode 100644
index 0000000..5e102e9
--- /dev/null
+++ b/examples/arithmetic.bdl
@@ -0,0 +1,22 @@
1;
2; Basic arithmetic operations
3;
4
5; Addition
6(+ 10 100)
7(+ 1 -2 3 4)
8
9; Substraction
10(- 100 75)
11(- 10 20 30)
12
13; Multiplication
14(* 10 7)
15(* -1 66)
16
17; Division
18(/ 45 5)
19(/ 10 5 2)
20
21; Nesting operations.
22(* 20 (+ 100 (- 50 30) (/ 300 3)) 10)