[Aldor-l] Using Aldor or SPAD

Ralf Hemmecke ralf at hemmecke.de
Sun Aug 20 07:13:31 EDT 2006


On 08/20/2006 11:14 AM, Martin Rubey wrote:
> Ralf Hemmecke <ralf at hemmecke.de> writes:
> 
>> For example,
>>
>> define Cat: Category == if odd? random() then {with {foo: () -> ()}}
>>                                           else {with {bar: () -> ()}}
>>
>> I could define a domain
>>
>> Dom: Cat == add {
>>     foo(): () == {}
>>     bar(): () == {}
>> }
>>
>> But how would I use it? At compile time the compiler cannot decide whether
>>
>> foo()$Dom;
>>
>> is actually available.
> 
> Well, isn't it (currently) possible to ask:
> 
>   if Dom has foo then ...

Good point. But you perhaps agree that things become cumbersome.

Should the compiler accept the lines

DomFoo: Cat == add {
     foo(): () == {}
}

? Certainly not. I suspect that even with the additional bar function 
the current compiler rejects that.

I haven't yet seen a use case for generation and use of categories at 
runtime. Any theoretical suggestions?

>> The final goal for species is to work with them interactively. So I don't
>> care if the interpreter in the middle of the session starts the compiler to
>> produce some efficient code for me, but it should be possible to produce a
>> "sufficiently efficient" standalone program.
> 
> Please note that I did write an Aldor program that takes a list of strings (the
> specification of a grammar) and that produces the corresponding domain. Thus, I
> think that
> 
>> And, in particular for species there seems to be need to call the compiler.

> is incorrect. To look at it, get 
> 
> svn://svn.risc.uni-linz.ac.at/hemmecke/combinat/branches/experiments/rubey

Martin, your approach seems to work, but I am still not sure whether it 
just works because of the current compiler. I would be happier if I had 
a sound explanation in terms of the *Aldor language* not in terms of the 
*compiler*.

Best regards
Ralf



More information about the Aldor-l mailing list