[Aldor-l] Semicolon after single statement in if?
Pippijn van Steenhoven
pip88nl at gmail.com
Wed May 6 16:47:04 EDT 2009
On Wed, May 06, 2009 at 04:11:59PM -0400, Bill Page wrote:
> Pippijn,
>
> I think what you wrote should not be allowed. Since ; is used to
> separate statements, the second line should be a syntactical error.
> Did you get a different result when you tried this?
#include "aldor.as"
#include "aldorio.as"
import from MachineInteger;
if (1 < 2) then stdout << "ok" << newline;
else stdout << "not ok" << newline;
The current aldor compiler will compile this fine and print "ok".
Removing the ; from either of the two last lines will be fine. The only
thing it does not accept is ;; anywhere. The point why I am asking this
is that in libaldor (I think, or maybe it was libalgebra), there are
several places where "if (a) then b; else c;" occurs and I don't think
this is actually valid.
--
Pippijn van Steenhoven
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://aldor.org/pipermail/aldor-l_aldor.org/attachments/20090506/744109e9/attachment.bin>
More information about the Aldor-l
mailing list