aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
authordos-reis <gdr@axiomatics.org>2011-11-26 10:02:08 +0000
committerdos-reis <gdr@axiomatics.org>2011-11-26 10:02:08 +0000
commitfee9f94ea1e25df6b75df2e195500e1e97c574be (patch)
tree2753f9d0a7f72c45b7c8b83578274a543042cc60 /src/interp
parent7b2ac81092d360b63ba6ff360aae7b2f8570133c (diff)
downloadopen-axiom-fee9f94ea1e25df6b75df2e195500e1e97c574be.tar.gz
* interp/c-util.boot (updateCapsuleDirectory): Simplify.
* interp/define.boot (compDefineCapsuleFunction): Call it from here. * interp/functor.boot (DescendCode): Not here.
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/c-util.boot12
-rw-r--r--src/interp/define.boot9
-rw-r--r--src/interp/functor.boot3
3 files changed, 9 insertions, 15 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot
index 3bc4a2e4..e9643db3 100644
--- a/src/interp/c-util.boot
+++ b/src/interp/c-util.boot
@@ -1211,18 +1211,12 @@ clearCapsuleDirectory() ==
++ slot number `slot'. A nil entry means that either the operation
++ is not defined, or it is conditional.
getCapsuleDirectoryEntry slot ==
- rest ASSOC(slot,$capsuleDirectory)
+ scalarTarget(slot,$capsuleDirectory)
++ Update the current capsule directory with entry controlled by
++ predicate `pred'.
-updateCapsuleDirectory(item,pred) ==
- pred ~= true => nil
- entry :=
- item is [['$,slot],['CONS,['dispatchFunction,fun],:.],:.] => [slot,:fun]
- item is [['$,slot],['CONS,'IDENTITY,
- ['FUNCALL,['dispatchFunction,fun],'$]]] => [slot,:fun]
- nil
- entry = nil => nil
+updateCapsuleDirectory(entry,pred) ==
+ pred isnt true => nil
$capsuleDirectory := [entry,:$capsuleDirectory]
diff --git a/src/interp/define.boot b/src/interp/define.boot
index 644f71dd..abc12e16 100644
--- a/src/interp/define.boot
+++ b/src/interp/define.boot
@@ -1848,13 +1848,14 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body],
formattedSig := formatUnabbreviatedSig signature
sayBrightly ['" compiling ",localOrExported,
:bright $op,'": ",:formattedSig]
-
- noteCapsuleFunctionDefinition($op,signature,makePredicate $predl)
+
+ pred := makePredicate $predl
+ noteCapsuleFunctionDefinition($op,signature,pred)
T := CATCH('compCapsuleBody, compOrCroak(body,rettype,e))
or [$ClearBodyToken,rettype,e]
- assignCapsuleFunctionSlot(db,$op,signature)
-- A THROW to the above CATCH occurs if too many semantic errors occur
-- see stackSemanticError
+ n := assignCapsuleFunctionSlot(db,$op,signature)
-- Build a name for the implementation.
op' :=
localOperation?($op,e) =>
@@ -1863,6 +1864,8 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body],
userError ['"%b",$op,'"%d",'" is local and exported"]
makeSymbol strconc(encodeItem $prefix,'";",encodeItem $op)
encodeFunctionName(db,$op,signature,'";",$suffix)
+ if n ~= nil and not $insideCategoryPackageIfTrue then
+ updateCapsuleDirectory([n,:op'],pred)
-- Let the backend know about this function's type
if $optProclaim then
proclaimCapsuleFunction(op',signature)
diff --git a/src/interp/functor.boot b/src/interp/functor.boot
index 1cf807a9..5a71aaf7 100644
--- a/src/interp/functor.boot
+++ b/src/interp/functor.boot
@@ -477,9 +477,6 @@ DescendCode(db,code,flag,viewAssoc,e) ==
'$
body:= ['CONS,implem,dom]
u := SetFunctionSlots(sig,body,flag,'original)
- -- ??? We do not resolve default definitions, yet.
- if not $insideCategoryPackageIfTrue then
- updateCapsuleDirectory([second(u).args,third u],flag)
ConstantCreator u =>
if flag ~= true then u:= ['%when,[ProcessCond(db,flag,e),u]]
$ConstantAssignments:= [u,:$ConstantAssignments]