Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
"while" with condition at end?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-02-09 (08:45)
From: Markus Mottl <mottl@m...>
Subject: "while" with condition at end?

I have just found out that there is no loop construct that checks the
termination condition at the end of the block. Is there some special
reason to this?

I'd like to write something like e.g.

  while (some_condition);

The only work-around is to either double the code and execute it once
before a "normal" while-loop (not elegant). The other option is to put
the block into a unit-function (a bit less efficient) and use it once
before and than in the loop (also not very elegant).
A construct of this kind would probably make the imperative features
more complete.

Best regards,
Markus Mottl

Markus Mottl,,