From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA27193; Thu, 11 Oct 2001 15:44:18 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id PAA27426 for ; Thu, 11 Oct 2001 15:44:17 +0200 (MET DST) Received: from www.image-acquire.com (valkyrie.image-acquire.com [207.71.8.230]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f9BDiFb13361; Thu, 11 Oct 2001 15:44:15 +0200 (MET DST) Received: from [192.168.0.2] (203-79-84-44.adsl.paradise.net.nz [203.79.84.44]) by www.image-acquire.com (8.9.3/8.9.3) with ESMTP id IAA14480; Thu, 11 Oct 2001 08:44:12 -0500 Mime-Version: 1.0 X-Sender: bruce@www.hoult.org Message-Id: In-Reply-To: <200110111334.PAA0000014200@beaune.inria.fr> References: <200110111334.PAA0000014200@beaune.inria.fr> Date: Fri, 12 Oct 2001 02:43:34 +1300 To: Damien Doligez , caml-list@inria.fr From: Bruce Hoult Subject: Re: [Caml-list] C style for loop Content-Type: text/plain; charset="us-ascii" ; format="flowed" Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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 > >>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