[434] in Coldmud discussion meeting

root meeting help first first in chain previous in chain previous next next in chain last in chain last

Re: "fixing" while loops

daemon@ATHENA.MIT.EDU (Thu Sep 22 18:36:34 1994 )

From: stewarta@netcom.com (Alex Stewart)
To: deforest@netcom.com (Robert de Forest)
Date: Thu, 22 Sep 1994 15:27:58 -0700 (PDT)
Cc: coldstuff@MIT.EDU
In-Reply-To: <199409221747.KAA23309@netcom14.netcom.com> from "Robert de Forest" at Sep 22, 94 10:47:12 am

> while a test (.test())
>   .do_something();

I'd kinda been considering this too but I hjust couldn't come up with a syntax
that didn't look butt ugly or make no syntactic sense within the language.. now
that I think about it some more, tho, howabout:

while {statements} (testexpr) statement(s)

(where the first statement block would be executed before the expressoion was
tested for truth value)  This actually has the advantage that it would
automatically expand the while statement to be able to do "until" loops, too,
and makes it a lot more flexible than a simple var addition.  Also, the old
'while (expr)' format could still be retained (just make it equivalent to
'while {} (expr)') for backwards compatibility and overall clarity in code that
tdidn't need the new feature.

maybe that would be the best way to deal with while loops anyway (regardless of
how the assignment-expression thing works out)..

-R
-------------------------------------------------------------------------------
   Alex Stewart - stewarta@netcom.com - Richelieu @ Diversity University MOO
             ftp://ftp.netcom.com/pub/stewarta/html/stewarta.html