[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Bruce Hoult <bruce@h...> |
| Subject: | Re: [Caml-list] C style for loop |
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