From fbfce55d3c7e5d0b71661b3f1ff9674fba6b8618 Mon Sep 17 00:00:00 2001 From: Bad Diode Date: Sat, 9 Oct 2021 12:54:15 +0200 Subject: Add support for file interpretaion or repl --- examples/arithmetic.bdl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 examples/arithmetic.bdl (limited to 'examples') 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 @@ +; +; Basic arithmetic operations +; + +; Addition +(+ 10 100) +(+ 1 -2 3 4) + +; Substraction +(- 100 75) +(- 10 20 30) + +; Multiplication +(* 10 7) +(* -1 66) + +; Division +(/ 45 5) +(/ 10 5 2) + +; Nesting operations. +(* 20 (+ 100 (- 50 30) (/ 300 3)) 10) -- cgit v1.2.1