[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Suggestion: add do-enddo(condition)

From: John W. Eaton
Subject: Re: Suggestion: add do-enddo(condition)
Date: Thu, 27 Jan 2000 19:50:17 -0600 (CST)

On 28-Jan-2000, Joao Cardoso <address@hidden> wrote:

| yes, when browsing an unknown script and founding a 'while' one has to
| check for both a 'do' (above) and a 'endwhile' (bellow). I 'vote' for
| repeat/until or do/until :(

I agree.  I just wrote

  j = i = 10; do while (i> 5) i--; i end, j--; j while (j > 5)

for testing, and I noticed that it was not so easy to see

| > 2) emacs (octave.el)?
| > repeat/until would be easy and unabiguous for all of the code readers.

Yes, it is not easy to tell the Emacs mode what to do for this:


when the cursor is at the point marked with ^.  Should it indent,
assuming that the while is in the body of the do ... XXX block, or
does the while end the do ... XXX block.

OK, so I think the solution is to drop do-while and go with do-until
only (it is trivial to just reverse the sense of the condition to make
one into the other anyway).

I know that some people would prefer `repeat', but I still prefer
`do'.  As someone (who shall remain nameless) commented in email:

  Here's my argument: "do is cool, and repeat sucks".



Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]