[fpc-devel] Fwd: While - Otherwise Statement

Martin Frb lazarus at mfriebe.de
Sun Oct 11 18:27:29 CEST 2015


On 11/10/2015 16:14, Sven Barth wrote:
>
> Am 11.10.2015 15:56 schrieb "MohsenTi" <mohsen.timar at gmail.com 
> <mailto:mohsen.timar at gmail.com>>:
> >
> > Hi everybody
> >
> > I add new feature to FPC compiler to simplify programming.
> > this is While - Otherwise working like While - Else in python and 
> has backwards compatibility.
>
> Nice idea with the otherwise. I first thought that this would break 
> case-statements that use otherwise instead of else, but then I 
> remembered that the case-label-blocks can and IMHO should be 
> terminated by ; anyway. At least problems can be easily circumvented.
>
"should", but they do not have to, at least not the last one before the 
otherwise

So if old code has
>   case a of
>     1 : write;
>     2:  while a > 1 do a := a -1
>     otherwise
>     write;
>     end
that will break. (it can be fixed, but so could the if with while else.

why not a new keyword?

while bool do
   foo()
afterwards [do]  // or even "then" would make sense (from english 
reading perspective)
   bar();





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20151011/d07e9037/attachment.html>


More information about the fpc-devel mailing list