Browse thread
The universal variable 'a would escape its scope
-
Christophe TROESTLER
-
Jacques Garrigue
- Christophe TROESTLER
-
Jacques Garrigue
[
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: | 2005-01-06 (01:56) |
From: | Christophe TROESTLER <Christophe.Troestler@u...> |
Subject: | Re: [Caml-list] The universal variable 'a would escape its scope |
On Thu, 06 Jan 2005, Jacques Garrigue <garrigue@math.nagoya-u.ac.jp> wrote: > > The workaround is to use a class-type: > > # class type t = object method output : (string -> unit) -> unit end;; > class type t = object method output : (string -> unit) -> unit end > # class a = object > method f : 'a. (#t as 'a) -> unit = fun o -> o#output print_string > end;; > class a : object method f : #t -> unit end > > This does exactly what you want. Thanks, ChriS