summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
Diffstat (limited to 'share')
-rw-r--r--share/txr/stdlib/struct.tl3
1 files changed, 3 insertions, 0 deletions
diff --git a/share/txr/stdlib/struct.tl b/share/txr/stdlib/struct.tl
index 45d8b4e9..c8eadc8b 100644
--- a/share/txr/stdlib/struct.tl
+++ b/share/txr/stdlib/struct.tl
@@ -149,6 +149,9 @@
(obj (throwf 'eval-error "~s: bad syntax: ~s" 'qref refs))))
(defmacro new (spec . pairs)
+ (if (oddp (length pairs))
+ (throwf 'eval-error "~s: slot initform arguments must occur pairwise"
+ 'new))
(let ((qpairs (mappend (aret ^(',@1 ,@2)) (tuples 2 pairs))))
(tree-case spec
((atom . args) ^(make-struct ',atom (list ,*qpairs) ,*args))