From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id C9F7BBC57 for ; Mon, 19 Jul 2010 09:30:47 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al0EAE6cQ0zCX7gsgWdsb2JhbACTM4w5FQEBFiIivmWFJQQ X-IronPort-AV: E=Sophos;i="4.55,226,1278280800"; d="scan'208";a="55757443" Received: from mailhost.mis.mpg.de ([194.95.184.44]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 19 Jul 2010 09:30:47 +0200 Received: from twww.mis.mpg.de (twww.mis.mpg.de [194.95.185.34]) by mailhost.mis.mpg.de (8.13.8/8.13.8) with ESMTP id o6J7UiRD016316; Mon, 19 Jul 2010 09:30:44 +0200 (MEST) Received: from [10.139.9.224] ([89.204.139.224]) (authenticated bits=0) by twww.mis.mpg.de (8.13.8/8.13.8) with ESMTP id o6J7UYnv021074 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 19 Jul 2010 09:30:42 +0200 (MEST) From: Keyan Zahedi Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Date: Mon, 19 Jul 2010 09:30:25 +0200 Subject: Setting function in a class To: caml-list@inria.fr Message-Id: <892ABE41-F325-4BC2-9C7B-C5B9DE63AC0B@pulsschlag.net> Mime-Version: 1.0 (Apple Message framework v1081) X-Mailer: Apple Mail (2.1081) X-MIS-Check-Sender: OK, user zahedi() has authenticated himself with PLAIN. X-Spam: no; 0.00; val:01 mutable:01 bool:01 functions:01 func:01 string:02 function:08 function:08 object:09 example:10 setting:10 create:12 question:13 type:14 does:14 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 =3D object val mutable _myfunc =3D (* a function of type string -> bool) method set_myfunc f =3D _myfunc <- f method my_func f =3D _myfunc f ;; of course the code above does not work. can anyone tell me how to do this? regards, keyan