From 9f2772a6d017e67ef9bd80b36bd3ab7c98e61894 Mon Sep 17 00:00:00 2001 From: Gabriel Dos Reis Date: Sun, 31 Jan 2016 14:09:50 -0800 Subject: Small cleanup in define.boot --- src/interp/compiler.boot | 4 ---- 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 @@ -50,10 +50,6 @@ module define where getCategoryObject: (%Table,%Form,%Env) -> %Shell ---% - -compDefine1: (%Maybe %Database,%Form,%Mode,%Env) -> %Maybe %Triple - --% $forceAdd := false @@ -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()] -- cgit v1.2.3