caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Bruce Hoult <bruce@hoult.org>
To: Damien Doligez <damien.doligez@inria.fr>, caml-list@inria.fr
Subject: Re: [Caml-list] C style for loop
Date: Fri, 12 Oct 2001 02:43:34 +1300	[thread overview]
Message-ID: <a05101014b7eb520d020a@[192.168.0.2]> (raw)
In-Reply-To: <200110111334.PAA0000014200@beaune.inria.fr>

At 3:34 PM +0200 11/10/01, Damien Doligez wrote:
>  >At 2:47 PM +0200 11/10/01, Berke Durak wrote:
>
>>>Do you really pretend that ``C-style for loops'' have ``self-evident
>>>readability merits'' ?! My opinion is that ```C-style'' loop syntax
>>>IS unreadable, ununderstandable and unprovable. How many people using
>>>C know the _exact_ semantics of :
>>>
>>>	for(exp1;expr2;expr3){expr4}
>
>>From: Bruce Hoult <bruce@hoult.org>
>
>>Sure, it's easy:
>>
>>    {
>>       exp1;
>>       while (expr2){
>>           expr4;
>>           expr3;
>>       }
>>    }
>>
>>It's damn ugly, though, and with much unnecessary repetition of the
>>control variable in simple cases.
>
>It's incorrect, too.  A "continue" statement within expr4 doesn't do
>the same thing in both versions.

I didn't include the "continue" semantics because:

1) the original example didn't have one
2) it requires a GOTO.  Feel free to insert a label before expr2 if you insist.

-- Bruce
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-10-11 13:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-11 13:34 Damien Doligez
2001-10-11 13:43 ` Bruce Hoult [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-10-11  5:47 Jeff Henrikson
2001-10-11  8:58 ` Daniel de Rauglaudre
2001-10-11 12:47 ` Berke Durak
2001-10-11 13:11   ` Bruce Hoult

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='a05101014b7eb520d020a@[192.168.0.2]' \
    --to=bruce@hoult.org \
    --cc=caml-list@inria.fr \
    --cc=damien.doligez@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;
as well as URLs for NNTP newsgroup(s).