diff options
author | Bad Diode <bd@badd10de.dev> | 2021-10-13 21:08:17 +0200 |
---|---|---|
committer | Bad Diode <bd@badd10de.dev> | 2021-10-13 21:08:17 +0200 |
commit | 00cf382196f81e22256e22e5c79a9d3503db5e91 (patch) | |
tree | 861137232ac8199beffd5c8d53284ec7be751fba /examples | |
parent | d38ae947933fe26773a810d91fba3b23766d4d92 (diff) | |
download | bdl-00cf382196f81e22256e22e5c79a9d3503db5e91.tar.gz bdl-00cf382196f81e22256e22e5c79a9d3503db5e91.zip |
Add supress-errors primitive and variable tests
Diffstat (limited to 'examples')
-rw-r--r-- | examples/variables.bdl | 16 |
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)) | ||