axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Unions in Spad


From: Gabriel Dos Reis
Subject: Re: [Axiom-developer] Unions in Spad
Date: 13 Jul 2007 03:45:02 -0500

Stephen Wilson <address@hidden> writes:

| Stephen Wilson <address@hidden> writes:
| 
| > > so if you write
| > > 
| > >    inj (n : Integer) : % == [n]
| > > 
| > > as above, that should be a type error.
| > 
| > On the contrary, it is a call to:
| >    
| >     construct : Integer -> %
| > 
| > which is well typed.
| 
| Sorry.  Again it is late.  Spad will perform automatic coercions for
| you from type Rep to type %, which is clearly the key point here.
| Often there is no need for `rep' and `per' as in Aldor.

However, many times I've come across to bugs in the Spad compiler
either unable to perform that automatic conversion, or that automatic
conversion seriously confuses it.  Note also that if an operation
is defined on both $ and Rep, then on takes precedence.  That choice
should be left to the user, who knows what he/she intended.
Therefore, I see a need for per and rep.  In fact, in my local
tree I have both per and rep -- but unlike Aldor, they are not
macros: they are built-in operators.  Ideally, I would like to
see pretend uses close to zero.

-- Gaby




reply via email to

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