diff options
Diffstat (limited to 'share')
-rw-r--r-- | share/txr/stdlib/defset.tl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/share/txr/stdlib/defset.tl b/share/txr/stdlib/defset.tl index 3fd8de2e..521260ba 100644 --- a/share/txr/stdlib/defset.tl +++ b/share/txr/stdlib/defset.tl @@ -67,10 +67,11 @@ (with-gensyms (getter setter) ^(defplace (,name ,*params) body (,getter ,setter - (let* ((gpf-pairs (append (mapcar (op list (gensym)) - (list ,*fixpars)))) + (let* ((gpf-pairs (mapcar (op list (gensym)) (list ,*fixpars))) (gpr-pairs (if ',restpar - (mapcar (op list (gensym)) ,restpar))) + (if (consp ,restpar) + (mapcar (op list (gensym)) ,restpar) + (list (list (gensym) ,restpar))))) (ext-pairs (mapcar (op list (gensym)) (list ,*extsyms))) (pgens [mapcar car gpf-pairs]) (rgens [mapcar car gpr-pairs]) @@ -81,7 +82,9 @@ ,*(zip ',extsyms (mapcar (ret ^',@1) egens)) ,*(if gpr-pairs - ^((,',restpar ',rgens)))) + (if (consp ,restpar) + ^((,',restpar ',rgens)) + ^((,',restpar ',(car rgens)))))) (macrolet ((,,getter () ,',getform) (,,setter (,',newval) ,',setform)) ,body)) |