Re: Catching Break?

From: Markus Mottl (mottl@miss.wu-wien.ac.at)
Date: Mon Feb 08 1999 - 21:14:47 MET


From: Markus Mottl <mottl@miss.wu-wien.ac.at>
Message-Id: <199902082014.VAA24823@miss.wu-wien.ac.at>
Subject: "while" with condition at end?
To: caml-list@inria.fr (OCAML)
Date: Mon, 8 Feb 1999 21:14:47 +0100 (MET)

Hello!

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.

  do
    ();
    ...;
  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, mottl@miss.wu-wien.ac.at, http://miss.wu-wien.ac.at/~mottl



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:19 MET