axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] Re: SPAD and Aldor again


From: Peter Broadbery
Subject: Re: [Axiom-developer] Re: SPAD and Aldor again
Date: Tue, 21 Nov 2006 21:28:43 +0000

On Tue, 2006-11-21 at 22:14 +0100, Ralf Hemmecke wrote:
> > Rep and Per are good for many things, but it might be worth adding a
> > shorthand for 'my representation is just a record'.  Don't think of Rep
> > as an instance variable - it's a mapping between your type and an
> > underlying one.  That said, a default representation of Rep + Record
> > might be an interesting idea.
> 
> Peter, perhaps you know ...
> 
> The only thing that makes "Rep", "rep", and "per" special is:
> 
> macro {
>       rep x == ((x)@%) pretend Rep;
>       per r == ((r)@Rep) pretend %;
> }
> 
> from include/aldor.as.
> 
> Now let us assume that everywhere in the libaldor sources we would replace
> 
>    Rep <--- Foo
>    rep <--- bar
>    per <--- rab
> 
> I guess the compiler would still accept the code and even produces an 
> identical library (up to name changes and hash codes etc).
> 

Yes, correct.  The fact that almost all domains require a representation
is an part of the language, even if the implementation of this is done
via convention.

> Or does the compiler know about a special treatment of "Rep" (in 
> contrast to "Foo")?
> 
> Going a bit further... is % known to the compiler? Or could I also 
> replace that (above and in everywhere.as file) by something else like 
> "Bar", for example?
> 

% is a different thing to the type being defined - this matters for
add-inheritance and in categories.

Peter






reply via email to

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