aboutsummaryrefslogtreecommitdiffstats
path: root/examples/variables.bdl
diff options
context:
space:
mode:
Diffstat (limited to 'examples/variables.bdl')
-rw-r--r--examples/variables.bdl16
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/variables.bdl b/examples/variables.bdl
new file mode 100644
index 0000000..6097368
--- /dev/null
+++ b/examples/variables.bdl
@@ -0,0 +1,16 @@
1;;
2;; Variable declarations and updates
3;;
4
5(supress-errors true)
6(print "(error? (def a 1)) -> ") (error? (def a 1))
7(print "a -> ") a
8(print "(error? (def a 300)) -> ") (error? (def a 300))
9(print "a -> ") a
10(print "(error? (def a \"strings\")) -> ") (error? (def a "strings"))
11(print "a -> ") a
12(print "(error? (def a 1)) -> ") (error? (def a '(quoted symbols 123 or "strings")))
13(print "a -> ") a
14(print "(error? (set! a 42)) -> ") (error? (set! a 42))
15(print "a -> ") a
16(print "(error? (set! b 99)) -> ") (error? (set! b 99))