[Aldor-l] {Spam?} bug with iterate
Ralf Hemmecke
ralf at hemmecke.de
Fri Jul 11 07:29:03 EDT 2008
Peter,
I somehow don't see your messages recorded on the aldor-l archive.
Aren't you subscribed?
Ralf
On 07/11/2008 12:15 PM, Peter Broadbery wrote:
> On Thu, Jul 10, 2008 at 5:29 AM, Ralf Hemmecke <ralf at hemmecke.de> wrote:
>> Hello,
>>
>> that looks like a bug to me.
>>
>> By mistake I've put an 'iterate' not in a 'repeat' body.
>> I think the compiler should reject that program instead of compiling it
>> and then looping forever when I running the program.
>>
>> Ralf
>>
>> aldor -fx -laldor bugIterate.as
>> bugIterate
>> foo0 = 1
>> foo1 = 1
>> foo0 = 2
>> -- program doesn't stop
>>
>>
>> ---BEGIN bugIterate.as
>> #include "aldor"
>> #include "aldorio"
>> import from Integer;
>> foo(i: Integer): () == {
>> stdout << "foo0 = " << i << newline;
>> if even? i then iterate;
>> stdout << "foo1 = " << i << newline;
>> }
>> main(): () == for i in 1..5 repeat foo(i);
>> main();
>> ---END bugIterate.as
>>
>
> Looks to be an unimplemented check, with code generation producing
> something daft. The obvious fix is to add some code to recognise an
> iterate (or break) that's not within a repeat clause - the code would
> go into abcheck.c. Only difficulty is in ensuring that one follows
> the syntax correctly - a break would be allowed only within contained
> sequence, conditions, exit clauses, try/catch clauses and probably one
> or two constructs.
>
> Peter
More information about the Aldor-l
mailing list