aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot7
-rw-r--r--src/interp/define.boot2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 89173ac0..8a305c37 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -54,6 +54,8 @@ $Representation := nil
$formalArgList := []
+++ The formal body of the category being currently compiled.
+$currentCategoryBody := nil
$compErrorMessageStack := nil
@@ -735,6 +737,11 @@ extendsCategoryForm(domain,form,form') ==
form is ["CATEGORY",.,:l] =>
member(form',l) or
stackWarning('"not known that %1 is of mode %2p",[form',form]) or true
+ -- if we are compiling the category `form', then we should look at
+ -- the body as provided in the current definition, not a version
+ -- possibly compiled previously that may have changed.
+ form = $functorForm =>
+ extendsCategoryForm(domain, $currentCategoryBody, form')
isCategoryForm(form,$EmptyEnvironment) =>
--Constructs the associated vector
formVec:=(compMakeCategoryObject(form,$e)).expr
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 42414d08..70ce8656 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -478,7 +478,7 @@ compDefineCategory2(form,signature,specialCases,body,m,e,
$functorForm:= $form:= [$op,:sargl]
$formalArgList:= [:sargl,:$formalArgList]
aList:= [[a,:sa] for a in argl for sa in sargl]
- formalBody:= SUBLIS(aList,body)
+ $currentCategoryBody : local := formalBody:= SUBLIS(aList,body)
signature' := SUBLIS(aList,signature')
--Begin lines for category default definitions
$functionStats: local:= [0,0]