[Aldor-l] exporting a domain in aldor
Ralf Hemmecke
ralf at hemmecke.de
Mon Jan 1 15:15:38 EST 2007
On 01/01/2007 08:21 PM, Martin Rubey wrote:
> Dear Aldor experts,
>
> I'd like to do the following, or something similar:
>
> #include "aldor"
>
> define Cat: Category == with {
> Dom: OutputType;
> f: () -> Dom;
> }
>
> DomA: Cat == add {
> Dom: OutputType == Integer;
> f(): Dom == 1783;
> }
>
> DomB: Cat == add {
> Dom: OutputType == String;
> f(): Dom == "abcd";
> }
>
> Of course, the code above does not work, since Dom has forgotten all the
> properties of Integer and String. But I hope that there is some other way to
> achieve the same thing. Of course, in real life, DomA and DomB have Rep's, and
> the exported constant Dom should be something like a second Rep.
Of course, the above code does not represent what you have in mind.
What about explaining your actual problem instead of translating your
problem (wrongly) into Aldor and claiming it were the problem? What do
you want to achieve?
Ralf
More information about the Aldor-l
mailing list