Browse thread
Re: [Caml-list] Mixing variant types...
[
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: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] Mixing variant types... |
On Fri, 2006-01-13 at 13:57 +0900, Jacques Garrigue wrote: > From: skaller <skaller@users.sourceforge.net> >> (* event.ml *) >> type +'a event = >> Communication of 'a behavior >> | Choose of 'a event list >> | WrapAbort of 'a event * (unit -> unit) >> | Guard of (unit -> 'a event) > The + above is not needed (it is implied by the definition) But it would fail if the type is not in fact covariant in its argument? > You still need to coerce the resulting list: > (List.map (fun w -> receive w.control) !windows :> ws_event list) Still doesn't seem to work: OUCH! Yes it DOES. Argg.. I modified otherlibs/threads/event.* but I didn't modify otherlibs/systhreads/event.* So when I compile with -thread it doesn't work. But when I compile with -vmthread it does work. Which is pretty conclusive proof the patch does work in at least one case. And if I'm right, the + in the implementation proves covariance mechanically so it should be safe. Should I add a feature request to the bug tracker? -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net