diff options
author | Gabriel Dos Reis <gdr@axiomatics.org> | 2016-01-31 14:09:50 -0800 |
---|---|---|
committer | Gabriel Dos Reis <gdr@axiomatics.org> | 2016-01-31 14:09:50 -0800 |
commit | 9f2772a6d017e67ef9bd80b36bd3ab7c98e61894 (patch) | |
tree | bdbeae3f1e4cfca0768caa4a654c6958e178db38 | |
parent | 96eba08809f7d9416840fa1d600fa777c25f9f60 (diff) | |
download | open-axiom-9f2772a6d017e67ef9bd80b36bd3ab7c98e61894.tar.gz |
Small cleanup in define.boot
-rw-r--r-- | src/interp/compiler.boot | 4 | ||||
-rw-r--r-- | src/interp/define.boot | 15 |
2 files changed, 3 insertions, 16 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot index 8b25f4fc..e369e1f9 100644 --- a/src/interp/compiler.boot +++ b/src/interp/compiler.boot @@ -1120,11 +1120,7 @@ compVector(l,m is ["Vector",mUnder],e) == --% MACROS -++ True if we are compiling a macro definition. -$macroIfTrue := false - compMacro(form,m,e) == - $macroIfTrue: local:= true ["MDEF",lhs,signature,rhs] := form if $verbose then prhs := diff --git a/src/interp/define.boot b/src/interp/define.boot index e41c3ac1..c9676be3 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -52,10 +52,6 @@ module define where --% -compDefine1: (%Maybe %Database,%Form,%Mode,%Env) -> %Maybe %Triple - ---% - $forceAdd := false $functionStats := nil @@ -736,10 +732,6 @@ checkParameterNames parms == for p in parms repeat checkVariableName p -compDefine(db,form,m,e) == - $macroIfTrue: local := false - compDefine1(db,form,m,e) - ++ We are about to process the body of a capsule. Check the form of ++ `Rep' definition, and whether it is appropriate to activate the ++ implicitly generated morphisms @@ -817,7 +809,7 @@ getSignatureFromMode(form,e) == #form~=#signature => stackAndThrow ["Wrong number of arguments: ",form] applySubst(pairList($FormalMapVariableList,form.args),signature) -compDefine1(db,form,m,e) == +compDefine(db,form,m,e) == $insideExpressionIfTrue: local:= false --1. decompose after macro-expanding form ['DEF,lhs,signature,rhs] := form := macroExpand(form,e) @@ -828,7 +820,7 @@ compDefine1(db,form,m,e) == null signature.target and symbol? KAR rhs and not builtinConstructor? KAR rhs and (sig := getSignatureFromMode(lhs,e)) => -- here signature of lhs is determined by a previous declaration - compDefine1(db,['DEF,lhs,[sig.target,:signature.source],rhs],m,e) + compDefine(db,['DEF,lhs,[sig.target,:signature.source],rhs],m,e) -- RDJ (11/83): when argument and return types are all declared, -- or arguments have types declared in the environment, @@ -977,7 +969,7 @@ compDefineCategory1(db,df is ['DEF,form,sig,body],m,e,fal) == $insideCategoryPackageIfTrue: local := true $categoryPredicateList: local := makeCategoryPredicates db defaults := mkCategoryPackage(db,cat,categoryCapsule,e) - T := compDefine1(nil,defaults,$EmptyMode,e) + T := compDefine(nil,defaults,$EmptyMode,e) or return stackSemanticError( ['"cannot compile defaults of",:bright opOf form],nil) [d,m,e] @@ -2109,7 +2101,6 @@ compile(db,u,signature) == $insideCapsuleFunctionIfTrue => putInLocalDomainReferences(db,optimizedBody) optimizedBody - $macroIfTrue => constructMacro stuffToCompile try spadCompileOrSetq(db,stuffToCompile) finally functionStats := [0,elapsedTime()] |