[Top][All Lists]

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

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

From: Ralf Hemmecke
Subject: Re: [Aldor-l] [Axiom-developer] Re: exports and constants
Date: Thu, 27 Jul 2006 20:18:01 +0200
User-agent: Thunderbird (X11/20060516)

Of course. But if you want to print out things you must be
able to convert to something that you can put onto a screen.

Yes you are right. In Axiom such output is a matter resolved
by providing (almost) every domain with a coercion function
to the OutputForm domain. Since in Axiom lisp underlies
everything, providing such a coercion is relatively easy.
In Aldor as a stand alone high level language I am not sure
exactly what the best solution is. Does it really make sense
that such a high level language should care about the name
that a particular programmer assigned to one of it's objects?

As I said before I don't aim at an implementation of reflections as a tool for the general user. I only want to have reflections for a few exceptional cases like AldorUnit or perhaps a debugger that is written in Aldor. Both would need a way to print the name of a function. (In general, of course the name is irrelevant. That is why I don't want reflections.)

MyDom: with
  exports:Generator Category
  add2:(MyDom,MyDom) -> MyDom
  sub2:(MyDom,MyDom) -> MyDom
  neg: MyDom -> MyDom
 == add
  import from Integer
  Rep == Integer

  exports:Generator Category == generate
    yield with {add2:(MyDom,MyDom)->MyDom}
    yield with {sub2:(MyDom,MyDom)->MyDom}
    yield with {neg:MyDom->MyDom}

  add2(x:%,y:%):% == per(rep(x) + rep(y))
  sub2(x:%,y:%):% == per(rep(x) - rep(y))
  neg(x:%):% == per(-rep(x))
I liked your code, but in fact that does not use reflection
at all and I think it should even compile. You are not doing
anything fancy.

Why do you say that this does not use reflection?

Because you give the "exports" constant explicitly. Suppose you later say

extend MyDom: with {foo:()->()} == add {foo(): () == {}}

Then exports$MyDom does not reflect the true exports since "foo" would be missing.

You don't relect about "MyDom" you just give an explicit constant.

I agree that this is nothing "fancy". Actually, reflection is
not really such a "fancy" concept at all, its just that we have
got used to not having access to this sort of information in
non lisp-based programming without first-order types.

Right, I am not used to reflection. Is there a collection of nice examples where reflection is a "must have"? I can only think about AldorUnit, a debugger and a way to ask a library which functionality it provides.

Yes, I agree that this should compile now. Obviously Aldor
does try to compile it but it fails for some obscure reason.

aldor -grun -laldor
"", line 17:     yield with {add2:(MyDom,MyDom)->MyDom}
[L17 C5] #1 (Fatal Error) Compiler bug: no exit list for terrorSequence


I guess this means I should submit a bug report ... but until
Aldor is open source or we find some other way to deal with it
I am not too strongly motivated.

I have the suspicion if you wrap the "with {..}" stuff with a Record, it might help. But it's a bug anyway.

> Given the urgency (to us at
least!) of resolving the issue of the open source status of
Aldor, I am disappointed not to hear anything yet from Steven
Watt or Mike Dewar as Mike did state directly in an email to
me that they intended to discuss it during the recent meetings
in Europe... :( I am again impatient and thinking about drastic

I can assure you that Stephen and Mike discussed the issue when they where both in Dagstuhl. And Tim and me met Stephen in Sophia-Antipolis at the Bronstein conference. Stephen told me that he wants to sort out the license issue until the end of August. It would of course be best to have Aldor free before the beginning of the next semester.


reply via email to

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