[clean-list] Passing an environment around

Jerzy Karczmarczuk karczma@info.unicaen.fr
Thu, 19 Oct 2000 09:17:26 +0100


José Romildo Malaquias  <== F.S.A.Zuurbier :


> > I can think of another possibility you may have to wait for:
> > If in current Clean you can make * or + an infix operator,
> > why can't I make (add env) an infix operator? Or maybe I CAN,
> > I have not tried.
> 
> This possibility looks good to me. But I could not find a way
> of making an expression an infix operator, like you sugest.
> I am not sure whether Clean support it.


M. Wierich says plainly NO.
Emmm.... Can't you use macros here?


====================

Another posting of José Romildo Malaquias:


> > If you tell me what operations on BigInts you need I'll 
> > send you an ExtendedArtih library that works on Clean 1.3.2.
> 
> I need the basic operations on integers:
> 
>         negation
>         addition
>         subtraction (not essential,...)
>         multiplication
>         division (quotient and remainder)
>         power (not essential, ...)
> 
>         equality
>         relations (< <= > >=)
> 
>         toString
>         fromString

++

I think you might (as I would myself...) need also
     the conversion from and to small integers (where applicable)
     the conversion from/to reals

But if you really need all this in order to have something
workable, not necessarily very efficient, it is quite easy to
build inf. precision integers in Clean itself! The algorithms
take 3 - 10 lines...

There are some surprises. For example people "know" that the
power operator constructed as x^n =x*x*x...*x is less efficient
than the algorithm based on the binary division of the exponent:
x^(2n) = (x^2)^n etc.
Well, hmmm. With very long data structures, where the complexity
of the multiplication is proportional to the square of the length,
the situation is less clear. Perform the analysis yourself, you
will see.


By the way. There was an attempt to build a symbolic algebra package
in Haskell (I lost the reference). It seems that JRM project is quite
similar.

I have to say that I feel a bit uneasy about that. I see the
creation of an undiscriminated expression processor, like Maple
(or Reduce), with dynamic typing and structural simplification
rules only, while --

I would personally prefer A LOT to have something along the lines
of Axiom/Magma/MuPAD, with strong categorization of objects.
With domains, axioms, etc.

Jerzy Karczmarczuk
Caen, France