Version française
Home     About     Download     Resources     Contact us    
Browse thread
Setting function in a class
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Keyan Zahedi <ml@p...>
Subject: Setting function in a class
hi,

i have the following question: i would like to create a class with functions that can be set later. here is an example:

class myclass =
object
val mutable _myfunc = (* a function of type string -> bool)
method set_myfunc f = _myfunc <- f
method my_func f = _myfunc f
;;

of course the code above does not work.

can anyone tell me how to do this?

regards,
keyan