Hi, There is currently a class of error that OpenAxiom (and all other AXIOM flavors) produces: a semantic error when an attempt is made to declare a variable or a local function of the same name as a record/union field name or a flag type name.
If I consider only at the current implementation of the compiler, I can understand why the error is made: most of the time, we try to infer the type of a symbol but it is not clear which of the two possible conflicting type should be inferred as _the_ type of a symbol that is both a literal and a variable. However, when I look at the affected code, e.g. in ModularDistinctDegreeFactorizer for example where the compiler produces Semantic Errors: [1] ddfactor: degree is BOTH a variable and a literal [2] ddfact: degree is BOTH a variable and a literal [3] ddFact: degree is BOTH a variable and a literal [4] sepfact: degree is BOTH a variable and a literal [5] separateFactors: degree is BOTH a variable and a literal [6] sepFact1: degree is BOTH a variable and a literal it looks `unambiguous' to me what the right symbol should should to in each context. Indeed, the compiler seems to eventually resolve to the right symbol. Consequently, there must be a specification (e.g. an algorithm) that systematically work without producing the above diagnostics. In my view, the context should help decide which interpretation of a symbol is desired, but that is not so simple because when faced with print pol.degree it is not always immediately clear whether '.degree' refers to a real function or a field of record. For the moment, I'm going to downgrade the above diagnostic to `warning'. And I would appreciate to know what people think. -- Gaby ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ open-axiom-devel mailing list open-axiom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/open-axiom-devel