axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] Re: [Aldor-l] [Axiom-math] Are Fraction and Complex do


From: Martin Rubey
Subject: [Axiom-developer] Re: [Aldor-l] [Axiom-math] Are Fraction and Complex domains.
Date: 17 May 2006 10:24:13 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

"Christian Aistleitner" <address@hidden> writes:

> Hello Martin,
> 
> On Tue, 16 May 2006 10:13:17 +0200, Martin Rubey  
> <address@hidden> wrote:
> 
> > Where does it say that Dom(x) and Dom(y) should be the same, even if x  
> > and y
> > are equal in some sense?

I should have been more precise: with "equal in some sense" I meant "not
exactly equal". In german it is easier: I meant "nicht dasselbe sondern nur das
gleiche".

> I guess nowhere. But typically, you'd expect it.

if x and y are "dasselbe" yes, otherwise no.
> 
> Consider
> a: List Integer := [ 1 ];
> b: List Integer := [ 2 ];
> you want to be able to call append!( a, b ), won't you?

yes, since (eq Integer Integer)

> But actually, you invoke the function List two times. Each time with the same
> argument (namely Integer).  If calling a function two times with the same
> argument yields the same (not the equivalent, but really the same) result, we
> call it "functional" in the discussion. Otherwise, we call it non
> functional. Just as with (functional) relations.

OK, I see now. It could be -- in the non functional setting -- that 

a: NonFunctionalDomainConstructor Integer := something
b: NonFunctionalDomainConstructor Integer := otherthing

and NonFunctionalDomainConstructor exports an operation f(%, %), but I still
*shouldn't* be able to call f(a, b), since a and b come from different
instantiations of NonFunctionalDomainConstructor Integer?

(Not currently, since it seems that Aldor instantiates a Domain only another
time, if the argument has changed.)

> > I would imagine that Dom(x) and Dom(y) are the same, (i.e., instantiated
> > only once) if x and y are the same, i.e., if (eq x y) as opposed to (equal
> > x y), but I'd be interested to find something about this in the
> > documentation.
> 
> That's the main point ... what kind of "equals" does Aldor apply?
> I do not know. Just look at the Dom example I gave.

which one? By the way: please include output of your aldor programs. It's
always a hassle for me to reproduce it.

> > I'd leave it unspecified.
> 
> Leaving compiler behaviour unspecified is a bad thing. 

No, not necessarily. Maybe I should have said "undefined". In Lisp this is the
case for many things. It's basically saying: "in principle it is an error, but
don't expect that I throw an error message".

> No user would be allowed to rely on calling List( Integer ) two times would
> give an identical result.

I agree that I wouldn't leave *this* unspecified, but I could imagine saying:

* domains are "compatible" (i.e., you may use append in the example you gave
  above), if their arguments were identical. In this case, the domain is
  instantiated only once.

* if their arguments were not identical, the behaviour is unspecified


thanks for getting me into the boat again,

Martin





reply via email to

[Prev in Thread] Current Thread [Next in Thread]