summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-24 06:09:52 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-24 06:09:52 -0700
commit96f7e4ab111b641d2f26b97f75ef4d81151417a1 (patch)
treedc7fae4f93bff8d2c0d1b67bd7b5a315e6d1bdae /tests
parenta513b69fd9b1e0f3925f1e33d44fe127dbb858e5 (diff)
downloadtxr-96f7e4ab111b641d2f26b97f75ef4d81151417a1.tar.gz
txr-96f7e4ab111b641d2f26b97f75ef4d81151417a1.tar.bz2
txr-96f7e4ab111b641d2f26b97f75ef4d81151417a1.zip
Fix non-working quasiquote over struct literals.
Turns out that there is missing support for quasiquoting over structs. Code analogous to the way vector and hash literals are handled is missing for structs. * eval.c (expand_qquote_rec): Handle struct_lit_s forms specially, like hash_lit_s and vector_lit_s. commit 1e5bc5708d5763f20a7774f9348e825304a51adc * struct.c (make_struct_lit_s): New symbol variable. (struct_init): Store interned sys:make-struct-lit symbol into make_struct_lit_s, and use that to register the function. * struct.h (make_struct_lit_s): Declared. * tests/012/struct.tl: Update struct literal quasiquote test cases to reflect fixed behavior.
Diffstat (limited to 'tests')
-rw-r--r--tests/012/struct.tl7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/012/struct.tl b/tests/012/struct.tl
index a55e8447..cecdfb15 100644
--- a/tests/012/struct.tl
+++ b/tests/012/struct.tl
@@ -11,11 +11,10 @@
(b (inc x))))
(test ^#S(bar b ,(+ 2 2))
- (sys:struct-lit
- bar b 4))
+ #S(bar a 103 b 4))
-(test (sys:expand ^#S(bar b ,(+ 2 2)))
- (sys:make-struct-lit 'bar '(b 4)))
+(test (sys:expand '^#S(bar b ,(+ 2 2)))
+ (sys:make-struct-lit 'bar (list 'b (+ 2 2))))
(defvar s (eval ^#S(bar b ,(+ 2 2))))