From: Keyan Zahedi <ml@pulsschlag.net>
To: caml-list@inria.fr
Subject: Setting function in a class
Date: Mon, 19 Jul 2010 09:30:25 +0200 [thread overview]
Message-ID: <892ABE41-F325-4BC2-9C7B-C5B9DE63AC0B@pulsschlag.net> (raw)
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
next reply other threads:[~2010-07-19 7:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-19 7:30 Keyan Zahedi [this message]
2010-07-19 7:37 ` [Caml-list] " Stéphane Glondu
2010-07-19 8:01 ` Keyan Zahedi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=892ABE41-F325-4BC2-9C7B-C5B9DE63AC0B@pulsschlag.net \
--to=ml@pulsschlag.net \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox