English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
for loops with stride
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1998-12-11 (14:14)
From: John Whitley <whitley@c...>
Subject: for loops with stride

Thanks to everyone who responded to my earlier question re:
composition.  Quite enlightening discussion...  8-)

On a hopefully less controversial note, I'd like to make a suggestion
for an addition to OCaml for-loops.  Consider an optional stride
parameter, as in:

for i = 0 to n-1 by stride do

At least in certain signal processing code that I'm working with
presently, the above is a common (and highly convenient) pattern.  The
corresponding while loop is simply not as easy to write or understand.