Browse thread
[Caml-list] lazy and marshal
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Kip Macy <kmacy@f...> |
| Subject: | Re: [Caml-list] lazy and marshal |
Marshal stores values or data structures, a lazy value by definition is one whose evaluation has been deferred. In order for the marshalling of lazy values to work, the thunk (or however deferred evaluation is handled in ocaml) and all the environment that it depends on would have to be marshalled. On Tue, 17 Jun 2003 sicard@poleia.lip6.fr wrote: > Hello > I don't understand the following error : > Marshalling a lazy value don't work when the value has not been computed. > > > # let a = lazy 0;; > val a : int lazy_t = <lazy> > # Marshal.to_string a [ Marshal.Closures ] ;; > Exception: Invalid_argument "output_value: abstract value". > > # Lazy.force a;; > - : int = 0 > # Marshal.to_string a [ Marshal.Closures ] ;; > - : string = > "\132\149??\000\000\000\001\000\000\000\000\000\000\000\000\000\000\000\000@" > # > > Thanks > > ------------------- > 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 > ------------------- 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