[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Axiomdeveloper] about Expression Integer
From: 
Ralf Hemmecke 
Subject: 
Re: [Axiomdeveloper] about Expression Integer 
Date: 
Mon, 20 Feb 2006 18:57:09 +0100 
Useragent: 
Thunderbird 1.5 (X11/20051201) 
Hallo Gaby,
On 02/20/2006 06:15 PM, Gabriel Dos Reis wrote:
Ralf Hemmecke <address@hidden> writes:
[...]
 > But eventually in order to program in Axiom, it is essential that
 > they gain a full appreciation of the objectoriented design
 > philosophy.

 I would not really like to call Axiom (or Aldor) objectoriented.
 We don't write

 a.add(b)

 in order to add two numbers.
There is more to objectorientation than "dot notation". To my eyes
and mind, Aldor and Axiom are objectoriented, and they haven't yet
escaped that land :(
Hmm, do you call the following objectoriented?
(That code appears in libalgebra distributed with Aldor and it basically
provides a generic function that given a function "f: R > S" returns a
function "map(f)" of type "RX > SX" that applies "f" on the
coefficients of a univariate polynomial.)
UnivariateFreeRing2(
R : Join(ArithmeticType, ExpressionType),
RX: UnivariateFreeRing R,
S : Join(ArithmeticType, ExpressionType),
SX: UnivariateFreeRing S
): with {
map: (R > S) > RX > SX;
} == add {
map(f:R > S)(p:RX):SX == {
q:SX := 0;
for term in p repeat {
(c, n) := term;
q := add!(q, f c, n);
}
q;
}
}
What is the class and what are the methods?
Can you write that in JAVA or CLOS? I would be happy to see it.
 the function "add" is not attached to the object a. It is rather that
 a and b are on equal footing.
"equal footing" is not contradictory to object orientation.
Well, you may be right. But when I read about implementation of complex
numbers in C++ and saw that a.add(b) construct, I really did not like it
(at least not in the context of mathematics). It is saying: sent the
message "add" with parameter "b" to the object "a". And it means that
"a" has to do the work since "a" knows how to add something to itself.
It is like saying. The integer 1 knows how another integer can be added
to it. I don't consider that thinking to be quite natural in the context
of mathematics. I agree, objectorientation be appropriate for other
contexts.
 then it becomes clear that Axiom has more to offer that the
 current trend in programming.
The current trend in programming is some heavy or displcaed emphasis
on generic programming.
Sorry that I don't know CLOS, but I have looked a bit into JAVA's
generics. And that is a lot weaker than what was already available in
Aldor several years ago.
BTW, I don't say that Aldor hasn't some kind of objectorientation, but
it is in my opinion not a pure objectoriented language.
Ralf
 RE: [Axiomdeveloper] about Expression Integer, (continued)
 RE: [Axiomdeveloper] about Expression Integer, Bill Page, 2006/02/23
 Re: [Axiomdeveloper] about Expression Integer, Martin Rubey, 2006/02/22
 RE: [Axiomdeveloper] about Expression Integer, Bill Page, 2006/02/22
 Re: [Axiomdeveloper] about Expression Integer, Francois Maltey, 2006/02/22
 Re: [Axiomdeveloper] about Expression Integer, Martin Rubey, 2006/02/23
 RE: [Axiomdeveloper] about Expression Integer, Bill Page, 2006/02/23
 Re: [Axiomdeveloper] about Expression Integer, Ralf Hemmecke, 2006/02/24
 Re: [Axiomdeveloper] about Expression Integer, William Sit, 2006/02/24
 Re: [Axiomdeveloper] about Expression Integer, Ralf Hemmecke, 2006/02/20
 Re: [Axiomdeveloper] about Expression Integer, Gabriel Dos Reis, 2006/02/20
 Re: [Axiomdeveloper] about Expression Integer,
Ralf Hemmecke <=
 RE: [Axiomdeveloper] about Expression Integer, Bill Page, 2006/02/20
 Re: [Axiomdeveloper] about Expression Integer, Gabriel Dos Reis, 2006/02/20
 Re: [Axiomdeveloper] about Expression Integer, Ralf Hemmecke, 2006/02/21
 Re: [Axiomdeveloper] about Expression Integer, Gabriel Dos Reis, 2006/02/21
 [Axiomdeveloper] 1: %, Ralf Hemmecke, 2006/02/21
 [Axiomdeveloper] Re: 1: %, Gabriel Dos Reis, 2006/02/21
 [Axiomdeveloper] Re: 1: %, Gabriel Dos Reis, 2006/02/21
 [Axiomdeveloper] Re: 1: %, Ralf Hemmecke, 2006/02/22
 [Axiomdeveloper] Re: 1: %, Gabriel Dos Reis, 2006/02/23
 [Axiomdeveloper] Re: 1: %, Ralf Hemmecke, 2006/02/22