[Aldor-l] Generators

Martin Rubey martin.rubey at univie.ac.at
Mon Nov 12 10:04:30 EST 2007


Ralf Hemmecke <ralf at hemmecke.de> writes:

> So we should even add more testcases.

I think it's better to have good testcases than many. But I do not care too
much.

> > for (a,b) in l repeat if a=1 then b := 2;
> > etc.  Is the latter illegal, btw.?
> 
> Why should that be illegal?
> 
> Would you say that
> 
> For
> 
> #include "aldor"
> import from Integer;
> l: List Integer := [1,2];
> for a in l repeat a := 42;
> 
> the compiler says
> 
> parrot:~/scratch>aldor aaa.as
> "aaa.as", line 5: for a in l repeat a := 42;
>                    ..................^
> [L5 C19] #1 (Error) Cannot explicitly assign a `for' variable.

Hehe, good guess, don't you think?  (I did not cheat!)

> But where is this in the AUG?

Even if it isn't in the AUG, I think it's good behaviour.  It just doesn't make
sense.

Martin




More information about the Aldor-l mailing list