diff options
author | dos-reis <gdr@axiomatics.org> | 2013-05-15 00:40:43 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2013-05-15 00:40:43 +0000 |
commit | d4dde65a0f23cef213aa03dbbb85cd2504af5b6f (patch) | |
tree | 8025b03eadace67a50393207fd90999b1987e64d /src/interp | |
parent | a97a8e2cbc7d6c86f79a5465cba20212deff66c9 (diff) | |
download | open-axiom-d4dde65a0f23cef213aa03dbbb85cd2504af5b6f.tar.gz |
* interp/define.boot (checkAndDeclare): Constructor parameter
shadowing.
* algebra/lodof.spad.pamphlet (SetOfMIntegersInOneToN): [enum]:
Lose last parameter. Adjust callers.
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/define.boot | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/interp/define.boot b/src/interp/define.boot index 89244baf..7228ea44 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -1768,11 +1768,13 @@ hasSigInTargetCategory(form,target,e) == first potentialSigList ++ Subroutine of compDefineCapsuleFunction. -checkAndDeclare(form,sig,e) == +checkAndDeclare(db,form,sig,e) == -- arguments with declared types must agree with those in sig; -- those that don't get declarations put into e for a in form.args for m in sig.source repeat isQuasiquote m => nil -- we just built m from a. + symbolMember?(a,dbParameters db) => + stackAndThrow('"Redeclaration of constructor parameter %1b",[a]) m1:= getArgumentMode(a,e) => not modeEqual(m1,m) => stack:= [" ",:bright a,'"must have type ",m, @@ -1826,8 +1828,8 @@ refineDefinitionSignature(form,signature,e) == signature' ++ Subroutine of compDefineCapsuleFunction. -processDefinitionParameters(form,signature,e) == - e := checkAndDeclare(form,signature,e) +processDefinitionParameters(db,form,signature,e) == + e := checkAndDeclare(db,form,signature,e) e := giveFormalParametersValues(form.args,e) e := addDomain(signature.target,e) e := compArgumentConditions e @@ -1901,7 +1903,7 @@ compDefineCapsuleFunction(db,df is ['DEF,form,signature,body], $formalArgList:= [:argl,:$formalArgList] signature := refineDefinitionSignature(form,signature,e) or return nil $signatureOfForm := signature --this global is bound in compCapsuleItems - e := processDefinitionParameters(form,signature,e) + e := processDefinitionParameters(db,form,signature,e) rettype := resolve(signature.target,$returnMode) localOrExported := |