"Bill Page" <[EMAIL PROTECTED]> writes:

> On November 17, 2006 1:03 PM Vanuxem Gregory
> > 
> > Le vendredi 17 novembre 2006 à 17:17 +0100, Martin Rubey a écrit :
> > 
> > [...]
> > 
> > > I want to get rid of
> > > that stupid ANY workaround in the series domains.
> > 
> > Get rid of ANY almost everywhere.
> > 
> 
> Why get rid of ANY? What is wrong with this idea? A very similar
> idea is used in Java that is often called "type ducking". This
> is a way to have dynamic types in an otherwise statically typed
> language. What is wrong with that?

There is nothing wrong with that in certain circumstances or as a temporary
workaround. But it is completely wrong if you can do better without. The only
reason why series needs ANY is that the type, for example,

UPXS(INT, x, 0)

has a parameter "expansion point", (in the example equal to zero), which is
given as argument to "series":

series(sin x, x=1783) returns an element of domain ANY, although it really
should be an element of UPXS(FRAC INT, x, 1783). There is some code hidden in
the interpreter that makes the user believe that it is an element of 
UPXS(FRAC INT, x, 1783), but if you want to use series in SPAD code, you are in
trouble.

The signature of series currently is

   [4] (D2,Equation D2) -> Any from ExpressionToUnivariatePowerSeries(
            D4,D2)
            if D2 has Join(AlgebraicallyClosedField,
            TranscendentalFunctionCategory,FunctionSpace D4) and D4 has
            Join(GcdDomain,OrderedSet,RetractableTo Integer,
            LinearlyExplicitRingOver Integer)

but it "should" be something like

   [4] (D2,eq: Equation D2) -> UPXS(D2, retract(lhs eq)@Symbol, rhs eq)
            from ExpressionToUnivariatePowerSeries(D4,D2)
            if D2 has Join(AlgebraicallyClosedField,
            TranscendentalFunctionCategory,FunctionSpace D4) and D4 has
            Join(GcdDomain,OrderedSet,RetractableTo Integer,
            LinearlyExplicitRingOver Integer)


Then you could use it also in SPAD.

No problem at all for Aldor.

Martin




_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer

Reply via email to