Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] C style for loop
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Damien Doligez <damien.doligez@i...>
Subject: Re: [Caml-list] C style for loop
>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.

-- Damien
-------------------
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