[Aldor-l] Should this "parser" work?

Christian Aistleitner tmgisi at gmx.at
Mon Oct 23 03:13:30 EDT 2006


Hello Martin,

On Sun, 22 Oct 2006 20:59:05 +0200, Martin Rubey  
<martin.rubey at univie.ac.at> wrote:


>         res: List CC := [];
>         for x in p repeat
>           res := cons(Atom, res);
>
> [...]
>
> However, it just occurred to me that maybe the setup is rather
>
> mem loc   depends on            Name / Variable   comment
>
> 00001000:                       CC
>
> 00002000: 00001000              List CC
>
> 00003000:                       Atom
>
> 00003001:                                         an instance of Atom
>
> 00005000: 00003001 00000000     res               contents pointer
>
> 00006000:                                         result of E(1)
>
> which would explain what happens.

I am not yet convinced that such a setup would explain the working of the  
code. However, I do not think, such a setup is used.

First of all, what do you mean by “instance of Atom”. Atom is a domain.
For the domain MachineInteger, 34 is an instance, just as 35 or 36 are.
But for Atom?

You probably mean “some copy/reference of/to the domain”. But I do not  
think, something like that happens.

Consider the following two lines of code:

res := cons( MachineInteger, res );
res := cons( MachineInteger, res );

When compiling them, the relevant part of the generated C code is

[...]
T0_res = fiCCall2(FiWord, l0->X9_cons, l0->X3_MachineInteger,
          T0_res);
T0_res = fiCCall2(FiWord, l0->X9_cons, l0->X3_MachineInteger,
          T0_res);
[...]

There are no lines in between. Of course, fiCCall2 could manage to create  
copies of the domain MachineInteger on the fly, but why should it?


> Do I understand correctly: "Universe" is the collection of [identifier,  
> type]
> in scope at a given point of execution?

Yes.


--
Kind regards,
Christian



More information about the Aldor-l mailing list