From 0d7cb228076354f893527bce2d426e21697832a9 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Sat, 15 Jan 2022 22:40:01 -0800 Subject: 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. --- csc/assert.csc | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 csc/assert.csc (limited to 'csc/assert.csc') 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))))))) -- cgit v1.3.1