aboutsummaryrefslogtreecommitdiffstats
path: root/csc/assert.csc
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-01-15 22:40:01 -0800
committerRose Hogenson <rhogenson@posteo.net>2022-01-15 22:40:01 -0800
commit0d7cb228076354f893527bce2d426e21697832a9 (patch)
treefa12d1afff4cdb077437b11544c9ef8f299cd88e /csc/assert.csc
parentWrite a first draft macro expander. (diff)
downloadchromatopelma-0d7cb228076354f893527bce2d426e21697832a9.tar.zst
Finish the macro expander.
It works!! At least it passes all the test cases. Next I will: 1. finish the builtins, 2. add a conversion to IR2 in continuation passing style, 3. add a compiler from IR2 to bytecode, 4. and add an option to the frontend compiler to generate a standalone executable.
Diffstat (limited to 'csc/assert.csc')
-rw-r--r--csc/assert.csc11
1 files changed, 11 insertions, 0 deletions
diff --git a/csc/assert.csc b/csc/assert.csc
new file mode 100644
index 0000000..84d2096
--- /dev/null
+++ b/csc/assert.csc
@@ -0,0 +1,11 @@
+(define-library (csc assert)
+ (export assert)
+ (import (scheme base))
+ (begin
+
+
+ (define-syntax assert
+ (syntax-rules ()
+ ((assert condition)
+ (unless condition
+ (error "assertion failed" 'condition)))))))