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
[Caml-list] [ANN] The Missing Library
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-04-28 (15:18)
From: John Goerzen <jgoerzen@c...>
Subject: Re: [Caml-list] [ANN] The Missing Library
On Wed, Apr 28, 2004 at 09:24:43PM +1000, skaller wrote:
> On Wed, 2004-04-28 at 19:18, Jon Harrop wrote:
> Control inversion. In Ocaml you can write:
> List.iter (fun x -> print_endline x) ["Hello"; "World"];;

[ snip ]

> while ( p != e) do print_endline (get p); incr p done;
 [ snip ]
> The List.iter style HOF is very limited in utility
> in a functional language: there is no state.

> In Ocaml you can add state of course. But it's a mess.

I don't find it all that problematic.  For one, you can just maintain
the state in the scope above the callback.  The callback has access to
all those variables, of course.  And you could always just pass whatever
object or record you like in to the callback.  Neither is all that
complex to me.

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners