[
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: | Remi VANICAT <vanicat@l...> |
| Subject: | Re: [Caml-list] Class Events |
"Warp" <warplayer@free.fr> writes: > Hello, i'm trying to have my class having some event callback like this : > > class wmenuitem (fcallback:wmenuitem->unit) = > object(self) > val func = fcallback > method activate = (func self) > end > > but I'm having : > > This expression has type < activate : 'a; .. > but is here used with type > wmenuitem = < .. > > Self type cannot escape its class > > Is it really true that self cannot be a parameter ? > Any help ? Yes : let the compiler guess the type : class wmenuitem (fcallback:'a -> unit) = object(self) val func = fcallback method activate = (func self) end -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr