From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 62270BC57 for ; Mon, 19 Jul 2010 09:37:30 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av0EAMecQ0y8pSsP/2dsb2JhbACDIJxMca4NkFWBKYMJcwSIVw X-IronPort-AV: E=Sophos;i="4.55,226,1278280800"; d="scan'208";a="64006672" Received: from iss.up7.fr ([188.165.43.15]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Jul 2010 09:37:30 +0200 Received: from [192.168.39.1] (korell.up7.invalid [192.168.39.1]) by iss.up7.fr (Postfix) with ESMTP id 84EF9122AF; Mon, 19 Jul 2010 09:37:29 +0200 (CEST) Message-ID: <4C4400B9.9040401@glondu.net> Date: Mon, 19 Jul 2010 09:37:29 +0200 From: =?UTF-8?B?U3TDqXBoYW5lIEdsb25kdQ==?= User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100620 Icedove/3.0.5 MIME-Version: 1.0 To: Keyan Zahedi Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Setting function in a class References: <892ABE41-F325-4BC2-9C7B-C5B9DE63AC0B@pulsschlag.net> In-Reply-To: <892ABE41-F325-4BC2-9C7B-C5B9DE63AC0B@pulsschlag.net> X-Enigmail-Version: 1.0.1 OpenPGP: id=49881AD3 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam: no; 0.00; val:01 mutable:01 bool:01 val:01 mutable:01 cheers:01 phane:98 steph:98 phane:98 caml-list:01 func:01 func:01 string:02 string:02 blocks:07 Le 19/07/2010 09:30, Keyan Zahedi a =C3=A9crit : > 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 > ;; I am not sure of what blocks you. Just making your snippet syntactically correct works: class myclass =3D object val mutable _myfunc =3D fun (s:string) -> true method set_myfunc f =3D _myfunc <- f method my_func f =3D _myfunc f end ;; Cheers, --=20 St=C3=A9phane