From ba4c153fd98a97fc3e6236de2bc3dfada23271f4 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 12 Mar 2003 20:40:28 +0000 Subject: [PATCH] Fix bug: STRUCTURE-TAG/DEFAULT-VALUE can't be used on untagged structures. --- v7/src/runtime/defstr.scm | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/v7/src/runtime/defstr.scm b/v7/src/runtime/defstr.scm index d2dc2e770..2efd8edff 100644 --- a/v7/src/runtime/defstr.scm +++ b/v7/src/runtime/defstr.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: defstr.scm,v 14.49 2003/03/11 05:00:41 cph Exp $ +$Id: defstr.scm,v 14.50 2003/03/12 20:40:28 cph Exp $ Copyright 1987,1988,1989,1990,1991,1992 Massachusetts Institute of Technology Copyright 1993,1994,1995,1996,1997,2000 Massachusetts Institute of Technology @@ -742,20 +742,25 @@ differences: (eq? slot rest)) name (let ((dv - (if (eq? type 'RECORD) - `(,(absolute - 'RECORD-TYPE-DEFAULT-VALUE - context) - ,(close (structure/tag-expression - structure) - context) - ',name) - `(,(absolute - 'STRUCTURE-TAG/DEFAULT-VALUE - context) - ,tag-expression - ',type - ',name)))) + (cond ((eq? type 'RECORD) + `(,(absolute + 'RECORD-TYPE-DEFAULT-VALUE + context) + ,(close + (structure/tag-expression + structure) + context) + ',name)) + (tag-expression + `(,(absolute + 'STRUCTURE-TAG/DEFAULT-VALUE + context) + ,tag-expression + ',type + ',name)) + (else + (close (slot/default slot) + context))))) (if (memq slot optional) `(IF (DEFAULT-OBJECT? ,name) ,dv ,name) dv))))) -- 2.25.1