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:13)
From: Till Varoquaux <till.varoquaux@g...>
Subject: Re: [Caml-list] Native delimited continuations for bytecode OCaml
Can your code be used for undelimited continuation? I am currently
using code that looks somewhat like this:

open Netchannels
open Marshal

let suspend ()=
  let oo=open_out "state"
  and save_state k=
    to_string k [Closures])
    (* Skips a warning because this function does not return (it is an exit
    ignore(exit 0)
  callcc save_state
  Saves the "state" the application is in as an base64 encoded marshalled
let _ =
  if (Sys.file_exists "state") then
    let res =

    let k=Marshal.from_string res 0 in
      throw k ()