summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--share/txr/stdlib/struct.tl6
1 files changed, 4 insertions, 2 deletions
diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl
index e57a82ac..5aa61d74 100644
--- a/share/txr/stdlib/struct.tl
+++ b/share/txr/stdlib/struct.tl
@@ -252,10 +252,12 @@
(tree-case spec
((atom . args)
(sys:check-struct form atom)
- ^(make-struct ',atom (list ,*qpairs) ,*args))
+ (if qpairs
+ ^(make-struct ',atom (list ,*qpairs) ,*args)
+ ^(struct-from-args ',atom ,*args)))
(atom
(sys:check-struct form atom)
- ^(make-struct ',atom (list ,*qpairs))))))
+ ^(struct-from-plist ',atom ,*qpairs)))))
(defmacro lnew (:form form spec . pairs)
(if (oddp (length pairs))