From 96f7e4ab111b641d2f26b97f75ef4d81151417a1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 24 Oct 2016 06:09:52 -0700 Subject: 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. --- tests/012/struct.tl | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'tests') 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)))) -- cgit v1.2.3