[Aldor-l] Should this "parser" work?
Martin Rubey
martin.rubey at univie.ac.at
Sun Oct 22 14:59:05 EDT 2006
Dear Christian,
thank's for your comments. I think I understand now. So here is the same setup,
rewritten. I omitted A, because it should make no difference. In fact, I
checked, replacing
A: CC == Atom;
res: List CC := [A for x in p];
with
res: List CC := [];
for x in p repeat
res := cons(Atom, res);
gives the same result. Curiously, the compiler doesn't compile
res: List CC := [Atom for x in p];
-------------------------------------------------------------------------------
mem loc depends on Name / Variable comment
00001000: CC
00002000: 00001000 List CC
00003000: Atom
00005000: 00003000 00000000 res contents pointer
00006000: result of E(1)
Now, the question is what E(1) really is. In the setup as written above one
would think it depends only on 00003000, which wouldn't be the "good" result.
The other possibility is
> Union(Atom, Cross( apply( 00005000, 1 ), apply( 00005000, 1 ) ) ) due to lazy
> evaluation. This would explain why the whole thing works, bit is very, very
> tricky.
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.
Do I understand correctly: "Universe" is the collection of [identifier, type]
in scope at a given point of execution?
Martin
More information about the Aldor-l
mailing list