Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* "while" with condition at end?
@ 1999-02-08 20:14 Markus Mottl
  1999-02-09  8:43 ` Pierre Weis
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Mottl @ 1999-02-08 20:14 UTC (permalink / raw)
  To: OCAML

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




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-02-09  8:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-02-08 20:14 "while" with condition at end? Markus Mottl
1999-02-09  8:43 ` Pierre Weis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox