'while/else' (ugh) (was Re: [oclug] Ruby)
Rod Giffin
rod at giffinscientific.com
Fri Jun 27 19:43:54 EDT 2003
On Fri, 2003-06-27 at 19:14, Francis J. A. Pinteric wrote:
> On 27 Jun 2003 18:35:13 -0400
> Rod Giffin <rod at giffinscientific.com> wrote:
> >
> > Remember this is an imaginary syntax for an imaginary language.
>
> It's not as speculative as you think ...
:) Good! lol.
> >
> > I'm not talking about what you can do in C, or C++, Java or whatnot,
> > I'm speculating about something new.
> >
>
> In the speculative language under discussion, the code above the above
> code would be written:
>
> while condition:
> do some instructions
> finally
> do some stuff
> end
How does it tell if the while loop iterated? Wait a minute. The
finally block could run whether or not the while runs, giving me a
chance to catch a condition I didn't predict, can't it. So it becomes a
bit like a try { } catch { } finally { } block in Java, only with the
exception handling inside of the finally along side any cleanup code,
instead of in a separate catch statement. What the heck, I could live
with that.
Rod.
More information about the OCLUG
mailing list