[Aldor-l] [Axiom-developer] Re: exports and constants

Ralf Hemmecke ralf at hemmecke.de
Wed Jul 26 04:04:20 EDT 2006


On 07/26/2006 07:53 AM, Christian Aistleitner wrote:

>> But perhaps "has" is not so weak. What other applications of
>> reflection are there other then conditional ones?

> I do not know if you'd consider that to be reflection or not...
> I'd need a generator for all the fields of a domain.
> I'd need a way to determine the type of a field.
> I'd need a way to generate all Domains (or functions mapping to domains) 
> in the top-level scope.
> I'd need a way instanciate a Domain completely at runtime.

Christian, I think that you should have said that reflection would be 
just perfect for your AldorUnit

http://www.risc.uni-linz.ac.at/software/aldor/aldorunit

Currently one has to add a few shell scripts in order to make working 
with AldorUnit convenient. It would be just perfect if (at least for 
AldorUnit) it is possible to say

MyTestDomain: TestCaseType with {
   testMult1: () -> ();
   testMult2: () -> ();
   ...
} == add { ... }

and AldorUnit could provide a function

runTest(T: TestCaseType): () == ...

and inside "runTest" it would figure out which "test...: ()->()" 
functions the given domain T provides. Then it would call all those 
functions. Of course, here a restricted reflection would suffice and 
calling a function of type "()->()" should not be a big problem with the 
type system.

I am somehow reluctant to allow reflections in general, but for certain 
types of problems (like AldorUnit) it would be quite advantagous. OR the 
Aldor compiler would support AldorUnit and several other tools (relying 
on reflections) that people come up with in the future, then reflections 
are not so important in my eyes.

Ralf



More information about the Aldor-l mailing list