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
Native delimited continuations for bytecode OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-03-01 (09:26)
From: Till Varoquaux <till.varoquaux@g...>
Subject: Re: [Caml-list] Native delimited continuations for bytecode OCaml
Oups, sorry the mail was sent while I was typing (someone accidentally
pressed enter...).

Can your code be used for unlimited continuation? I am currently
using code that looks somewhat like this:

let suspend ()=
   and save_state k=
     let oc=open_out_bin "state" in
       Marshal.to_channel  oc  k  [Marshal.Closures]);
       close_out oc;
     (* Skips a warning because this function does not return (it is an exit
     ignore(exit 0)
   callcc save_state
(* If there is a resume point skip to it
 let _ =
   if (Sys.file_exists "state") then
    ( let oi = open_in_bin "state" in
      let k=Marshal.from_channel   oi in
       close_in oi;
       throw k ());

[note]This code was simplified for sake of clarity and might have small errors.

I was wondering if something similar is possible with your library?

Till Varoquaux