Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Markus Mottl <mottl@miss.wu-wien.ac.at>
To: caml-list@inria.fr (OCAML)
Subject: "while" with condition at end?
Date: Mon, 8 Feb 1999 21:14:47 +0100 (MET)	[thread overview]
Message-ID: <199902082014.VAA24823@miss.wu-wien.ac.at> (raw)

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




             reply	other threads:[~1999-02-09  8:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-08 20:14 Markus Mottl [this message]
1999-02-09  8:43 ` Pierre Weis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199902082014.VAA24823@miss.wu-wien.ac.at \
    --to=mottl@miss.wu-wien.ac.at \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox