At 12:25 +0100 1999/05/05, Jerzy Karczmarczuk wrote:
>Operations within a class are not Objects (instances of).

I have noticed that there is a simple principle of abstraction (or generality):

If one wants to achieve a greater generality, allow the operations to be
objects.

It a achieves a greater generality, because the operations then can be
manipulated as objects.

A simple example is the use of a generic variable, which enables one to
write a single algorithm which can manipulate many different types of
objects. Here, the class of object that the algorithm can manipulate has
become a single object, the generic variable. The spinoff is that the
algorithm needs only be written once for all those objects, and becomes
more structured for the humans to understand.

>So, we are very far from such small problems as tickering with (+) or
>(*). By the way, you don't need to rewrite the Prelude, you may just
>screen it through <<Import hiding>>. I do it all the time (and I have
>some unsolvable problems with Nums which seem to be hard coded within
>the compiler, but I can live with it).

Of course, not being able to use the correct + instead of * turns out to be
a major hurdle for those in need of it, those that want to write programs
which are more structured, and catches the originally intended semantics.

Should one really be forced to rewrite the Prelude in order to express
basic mathematical notions?

It seems me that in any computer language that the programmer has to spend
much time and effort on workarounds, there is something wrong with that
language.

  Hans Aberg
                  * Email: Hans Aberg <mailto:[EMAIL PROTECTED]>
                  * Home Page: <http://www.matematik.su.se/~haberg/>
                  * AMS member listing: <http://www.ams.org/cml/>




Reply via email to