From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 21ECDBC57 for ; Wed, 8 Sep 2010 07:05:19 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjIFAOS1hkzV+668/2dsb2JhbACTYI4ewDWFPQSEQw X-IronPort-AV: E=Sophos;i="4.56,332,1280700000"; d="scan'208";a="56823640" Received: from rastageeks.org (HELO mail.rastageeks.org) ([213.251.174.188]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 08 Sep 2010 07:05:18 +0200 Received: from leonard.localnet (ip174-70-125-221.no.no.cox.net [174.70.125.221]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.rastageeks.org (Postfix) with ESMTPSA id F045747908 for ; Wed, 8 Sep 2010 07:22:52 +0200 (CEST) From: Romain Beauxis To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] C binding and GC interaction: storing values outside the heap Date: Wed, 8 Sep 2010 00:06:57 -0500 User-Agent: KMail/1.13.5 (Linux/2.6.32-4-amd64; KDE/4.4.5; x86_64; ; ) References: In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Message-Id: <201009080006.59336.toots@rastageeks.org> X-Spam: no; 0.00; camlprim:01 foo:01 val:01 foo:01 mli:01 val:01 heap:01 caml-list:01 callback:02 callback:02 caml:02 interaction:02 binding:02 handler:03 handler:03 Hi, Le mardi 7 septembre 2010 15:58:04, Paolo Donadeo a =E9crit : > Any ideas or suggestions? I'm sorry if I missed something obvious, but why don't you simply require t= he=20 callback in the CAMLprim function's arguments and then wrap it in the ML co= de? Something like: =2Eml: type handler type callback =3D foo -> bar type t =3D handler * callback val foo : handler -> callback -> bar =3D "caml_lua_foo" let foo (h,c) =3D foo h c =2Emli: type t val foo : t -> bar Romain