[fpc-devel] Fwd: While - Otherwise Statement

Sven Barth pascaldragon at googlemail.com
Mon Oct 12 17:28:26 CEST 2015


Am 12.10.2015 17:17 schrieb "Dmitry Boyarintsev" <skalogryz.lists at gmail.com
>:
> About while-then. While the syntax is unlikely to break anything, it's
inconsistent with if-statement.
> where, if-then is executed when condition is true.
> For while-then is executed then condition is false.
> Thus, while-else or while-otherwise are better. However, both syntax
would cause code incompatibility.

It's less about consistency with if-then, but more about consistency from a
human language point of view.

"while true do this then that" reads more or less as well as "while true do
this otherwise that" (though both carry a slightly different meaning) with
the added benefit of the former not to break any existing code (as you had
written yourself).

Regards,
Sven
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20151012/08a32297/attachment.html>


More information about the fpc-devel mailing list