Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Lazy.Value
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: [Caml-list] Lazy.Value
> I may say nonsense, but is it possible to generalize things like:
>    ref (Lazy.Value [])

No, this would be unsound -- like all polymorphic references.

                let r = ref (Lazy.Value []) in
                  r := Lazy.Value [1];
                  match !r with [f] -> f 0  (*crash*)

- Xavier Leroy
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr