09-09-2015, 04:50 PM
@Boriel,
Yeah I got a bit carried away and my hack will probably crash or fail it encounters non-constant values but maybe there's still some potential there if some protective code were added for the non-constant cases.
I guess I naively thought that a FOR loop did work like DO UNTIL but I see that even with sinclair BASIC it works more like a C for loop so its obviously standard behaviour.
Probably the most important thing right so is to add the missing 'implicit' warning for FOR (when not using --explicit).
@Einar,
Actually the compiler does consider all three because it calls common_type twice. So hopefully your cases would be handled OK. My hack would still fail with variable upperbound and step of course...
Yeah I got a bit carried away and my hack will probably crash or fail it encounters non-constant values but maybe there's still some potential there if some protective code were added for the non-constant cases.
I guess I naively thought that a FOR loop did work like DO UNTIL but I see that even with sinclair BASIC it works more like a C for loop so its obviously standard behaviour.
Probably the most important thing right so is to add the missing 'implicit' warning for FOR (when not using --explicit).
@Einar,
Actually the compiler does consider all three because it calls common_type twice. So hopefully your cases would be handled OK. My hack would still fail with variable upperbound and step of course...