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] static variables in a function
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-14 (17:08)
From: Shannon --jj Behrens <jjinux@y...>
Subject: [Caml-list] static variables in a function

What is the correct OCAML idiom for achieving the
following psuedocode?

let get_chunk () =
  static chunks_list;

  if List.is_empty chunks_list
  then chunks_list = get_more_chunks ();
  shift chunks_list

Thanks You,

Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
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