> One basic rule would be that a domain `functor' memoizes its
> arguments, and always returns the same object for equal arguments,
> performing any required initialization on the first call.
Of course you know that globally defined functors can be called in a
local environment which would allow Foo(Integer) and Foo(Integer) to be
different things in different contexts of the same program.
> Of course
> equality is an issue in and of itself, but (for the purpos of functor
> memoization) my feeling is that Integer should not be equal to 'extend
> Integer ...' except when the extension is empty.
Ask two mathematician of all the properties of "integer". They probably
tell you different sets of functions. But if we use Integer in a program
all we care about is what properties it has at the time we use it.
How would you distinguish 'Integer' from 'extend Integer' anyway? I
think for me the difference is irrelevant. All I want to see is Integer
and not Integer1, Integer2, etc.
> Furthere, no
> extended domain D would be equal to any other extension of D,
> similarly for extensions of extensions, etc.
> As an aside, I feel that runtime equality checks on values (domain
> elements) should be permited only for those domains which implement
> BasicType (in which case I would support making BasicType a primitive
> language defined category).
Why should BasicType (i.e. =:(%,%)->Boolean) be a primitive? I don't see
any need.
> Another option being to use whatever
> export '=: (%, %) -> Boolean' the domain admits, or perhaps the
> equivalent Aldor `generic tie-in' which I think is `test'.
What? "test" is not a replacement for "=" in Aldor.
> I strongly feel that SPAD should define precise semantics for any
> notion of equality used by the compiler.
If I am not completely wrong then Aldor does not define any meaning for
=. It is a function as any other that a user defines.
In Aldor one cannot currently compile something like
if T = Integer then ... else ...
because there is no (implementation of a) function
=: (Type, Type) -> Boolean
and defining one yourself you would have to use "pretend Pointer". But
even then I guess it might happen that you have "T=T" returning false.
Ralf
_______________________________________________
Axiom-developer mailing list
Axiom-developer@nongnu.org
http://lists.nongnu.org/mailman/listinfo/axiom-developer