Serge D. Mechveliani wrote:
> 
> Waldek Hebisch  wrote
> 
> > The Axiom book, and in particular first chapters, is intended
> > to introduce readers to Axiom.  Fine distinctions between
> > language and library would probably overwhelm the readers.
> 
> The matter is that
>     it is very difficult to understand from the book just
>     what are the main constructs and principles of the
>     Axiom programming language.
>     Just to understand the issense of the language.
> 
> 
> > Spad allows much heavier overloading then is possible in Haskell.
> > [..]
> 
> Haskell has much of overloading. I do not know of any example of what
> needs more overloading. May be, you give such?

Well:

1) Let r be elements of a Ring R and v element of module over R.
   r*v, r*r, v*r are legal, call different functions (and the
   function are not related by inheritance) while v*v is
   illegal.  AFAICS it is impossible to get such result via
   inheritance.

> 1) And what about ML or such languages?

Core ML (without algebraic types and modules) can be embedded in
Spad.  Namely, any function f in core ML has type of form
E(A1, A2,...,AN) where A are free parameters and E is type
expression build from '->', lists, records and unions.  You
put f in package of form:

f_pack(A1 : Type, A2 : Type, ..., AN : Type) : with
   f : E(A1, A2,...,AN)
 == add
   f(...) ==
      code for f

and in calls replace f by f$f_pack(t1, t2, ..., tn) where
t1, t2, ..., tn are type expressions corresponding to use
in this call.  This is ugly due to extra packages and
qualifications for calls, but in practice usually one can
put several funtions in a package and omit most of
package qualifications.  OTOH Spad is more general, because
in Spad you can write:

f_pack(A1 : Cat1, A2 : Cat2, ..., AN : CatN) ...

that is restrict type of parameters (and of course the
comparison with Haskell applies too).  Spad does not have
algebraic data types (this is nothing fundamental, just
restriction of current implementation).  There are
various extensions of ML, for example DML allows attaching
condition to types.  Spad categories allow expressing
some condition, DML allows quite different conditions.


-- 
                              Waldek Hebisch
[email protected] 

-- 
You received this message because you are subscribed to the Google Groups 
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/fricas-devel?hl=en.

Reply via email to