gm2
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gm2] Re: A limitation in gm2 ?


From: Gaius Mulley
Subject: [Gm2] Re: A limitation in gm2 ?
Date: Thu, 06 May 2010 17:39:50 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Steve Giess <address@hidden> writes:

> Dear Gaius,
>  
>  I tried using a floating point variable in a FOR loop. This raised a tree
> parsing error.
>  
>  r : REAL;
>  ....
>  
>  FOR r:= 0.0 TO 7.0 DO
> ...
>  
>  END;
>  
> The only copy I have access to of the Modula-2 definition implies that this
> should be legal (albeit with step sizes limited to whole numbers). Is it a
> limitation on your gm2 implementation?

Hi Steve,

ahh yes - I thought for loops only allowed ordinal valued expressions.
Upon reading the standard it does not rule floating point values out
of for loops - I'll fix this!

> Yes, I know FP loops are not the best, but otherwise having to scatter  VAL
> (REAL, integer_loop_variable) expressions in complex REAL mathematical
> expressions makes for hard-to-read code.

indeed..!  Will fix..

regards,
Gaius




reply via email to

[Prev in Thread] Current Thread [Next in Thread]