From 4126dc2b32ee818635e57990b3e6f647b9a7dbcb Mon Sep 17 00:00:00 2001 From: dos-reis Date: Thu, 18 Sep 2008 14:26:35 +0000 Subject: * interp/c-util.boot (displayAmbiguousSignatures): New. (ambiguousSignatureError): Likewise. * interp/define.boot (hasSigInTargetCategory): Use it to reject ambiguous lhs of a definition. * interp/lisplib.boot (leaveIfErrors): Fix typo. * algebra/aggcat.spad.pamphlet: Disambiguate definitions. * algebra/card.spad.pamphlet: Likewise. * algebra/dhmatrix.spad.pamphlet: Likewise. * algebra/divisor.spad.pamphlet: Likewise. * algebra/expexpan.spad.pamphlet: Likewise. * algebra/ffcat.spad.pamphlet: Likewise. * algebra/ffcg.spad.pamphlet: Likewise. * algebra/ffnb.spad.pamphlet: Likewise. * algebra/ffp.spad.pamphlet: Likewise. * algebra/generic.spad.pamphlet: Likewise. * algebra/groebf.spad.pamphlet: Likewise. * algebra/modring.spad.pamphlet: Likewise. * algebra/moebius.spad.pamphlet: Likewise. * algebra/mts.spad.pamphlet: Likewise. * algebra/naalgc.spad.pamphlet: Likewise. * algebra/ore.spad.pamphlet: Likewise. * algebra/outform.spad.pamphlet: Likewise. * algebra/pf.spad.pamphlet: Likewise. * algebra/poly.spad.pamphlet: Likewise. * algebra/polycat.spad.pamphlet: Likewise. * algebra/prtition.spad.pamphlet: Likewise. * algebra/radix.spad.pamphlet: Likewise. * algebra/rep2.spad.pamphlet: Likewise. * algebra/stream.spad.pamphlet: Likewise. * algebra/string.spad.pamphlet: Likewise. * algebra/tree.spad.pamphlet: Likewise. * algebra/triset.spad.pamphlet: Likewise. * algebra/view2D.spad.pamphlet: Likewise. * algebra/sf.spad.pamphlet: Remove signature for hash. * algebra/si.spad.pamphlet: Likewise. --- src/interp/c-util.boot | 14 ++++++++++++++ src/interp/define.boot | 6 ++---- src/interp/lisplib.boot | 2 +- 3 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/interp') diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index c45159a7..3735a815 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -794,3 +794,17 @@ displayModemaps E == GCOPY ob == COPY ob -- for now +--% +++ format the set of candidate operations. +displayAmbiguousSignatures(op,sigs) == + [:showCandidate(op, sig) for sig in sigs] where + showCandidate(op,sig) == + ["%l", " ", op, '": ", + :bright formatUnabbreviated ["Mapping",:sig]] + +++ Display diagnostic message about ambiguous operation `op', with +++ possible resolutions given by the list `sigs'. +ambiguousSignatureError(op, sigs) == + stackSemanticError(['"signature of lhs not unique. Candidates are:", + :displayAmbiguousSignatures($op,sigs)],nil) + diff --git a/src/interp/define.boot b/src/interp/define.boot index 2e096be4..2d1a94e4 100644 --- a/src/interp/define.boot +++ b/src/interp/define.boot @@ -996,10 +996,8 @@ hasSigInTargetCategory(argl,form,opsig,e) == --accept only those signatures op right length which match declared modes 0=c => (#(sig:= getSignatureFromMode(form,e))=#form => sig; nil) 1 - sig:= first potentialSigList - stackWarning('"signature of lhs not unique: %1bp chosen", - [["Mapping",:sig]]) - sig + ambiguousSignatureError($op,potentialSigList) + first potentialSigList nil --this branch will force all arguments to be declared compareMode2Arg(x,m) == null x or modeEqual(x,m) diff --git a/src/interp/lisplib.boot b/src/interp/lisplib.boot index 7296b447..641b2799 100644 --- a/src/interp/lisplib.boot +++ b/src/interp/lisplib.boot @@ -425,7 +425,7 @@ initializeLisplib libName == ++ return to toplevel reader. leaveIfErrors libName == errorCount() ^=0 => - sayMSG ['" Errors in processing ",$liplibkind,'" ",:bright libName,'":"] + sayMSG ['" Errors in processing ",$lisplibKind,'" ",:bright libName,'":"] sayMSG ['" not replacing ",$spadLibFT,'" for",:bright libName] spadThrow() -- cgit v1.2.3