Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* Setting function in a class
@ 2010-07-19  7:30 Keyan Zahedi
  2010-07-19  7:37 ` [Caml-list] " Stéphane Glondu
  0 siblings, 1 reply; 3+ messages in thread
From: Keyan Zahedi @ 2010-07-19  7:30 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-07-19  8:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-19  7:30 Setting function in a class Keyan Zahedi
2010-07-19  7:37 ` [Caml-list] " Stéphane Glondu
2010-07-19  8:01   ` Keyan Zahedi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox