diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 6 | ||||
-rw-r--r-- | src/interp/c-util.boot | 12 | ||||
-rw-r--r-- | src/interp/define.boot | 9 | ||||
-rw-r--r-- | src/interp/functor.boot | 3 |
4 files changed, 15 insertions, 15 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 36762a23..f6fe5c1c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,11 @@ 2011-11-26 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/c-util.boot (updateCapsuleDirectory): Simplify. + * interp/define.boot (compDefineCapsuleFunction): Call it from here. + * interp/functor.boot (DescendCode): Not here. + +2011-11-26 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/define.boot ($NRTdeltaList): Remove. ($NRTdeltaListComp): Likeewise. (compDefineFunctor1): Do not bind them. 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] |