> -----Message d'origine-----
> De : Ralf Hemmecke [mailto:[EMAIL PROTECTED]
> Envoyé : mardi 27 septembre 2005 16:30
> À : Vanuxem Gregory
> Cc : Martin Rubey; axiom-dev
> Objet : Re: [Axiom-developer] RE: Types as values,and Re: Static
> versusDynamicallytyped(was:Philosophy... )
>
>
> [snip]
>
> >>However, the desirable query
> >>
> >> if R has QuotientField S
> >>
> >>thus defining S is, I think, quite difficult to implement
> >>sensibly. Throughout
> >>Axiom, this effect is obtained by adding another parameter to the
> >>Package/Domain signature like:
> >>
> >>MyPackage(F: Field, S: IntegralDomain): ...
> >>
> >> if F is Fraction S then
>
> Martin, do you really mean "is" instead of "has"? I don't think that
> your "if" expression works with Aldor.
>
> Anyway, if I were a compiler/interpreter, what would I do with something
> like
>
> if F is Fraction S then ...
>
> I would first evaluate the function "Fraction" obtaining a type T and
> then check whether F and T are the same thing. S would be lost. One
> could only achieve your wish by pattern matching, but Axiom doesn't work
> that way, does it?
>
> > I think that works only in function definition but not in function
> > decalaration.
>
> Greg, what do you mean by that?
I think in axiom the keyword 'is' works only where we define function
(and not in function declaration) in other words:
MyPackage(F: Field, S: IntegralDomain): ...
myfunc(%):Type -> Type
add
if F is Fraction S then
myfunc...
else
myfunc...
Cheers,
Greg
>
> Ralf
>
_______________________________________________
Axiom-developer mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/axiom-developer