From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA10968; Thu, 17 Jul 2003 17:25:28 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA15811 for ; Thu, 17 Jul 2003 17:25:27 +0200 (MET DST) Received: from linux.research.att.com (H-135-207-24-16.research.att.com [135.207.24.16]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h6HFPQT26230 for ; Thu, 17 Jul 2003 17:25:26 +0200 (MET DST) Received: from bigmail.research.att.com (bigmail.research.att.com [135.207.30.101]) by linux.research.att.com (8.12.8/8.12.8) with ESMTP id h6HFerJh029333 for ; Thu, 17 Jul 2003 11:40:53 -0400 Received: from castle4084.research.att.com (castle4084.research.att.com [135.207.36.84]) by bigmail.research.att.com (8.11.6+Sun/8.11.6) with ESMTP id h6HFPOV18713; Thu, 17 Jul 2003 11:25:24 -0400 (EDT) Subject: [Caml-list] Two questions about using the CamlIDL From: Mary Fernandez To: caml-list@inria.fr Cc: "Ricardo H. Medel" , Kathleen S Fisher , Robert E Gruber Content-Type: text/plain Organization: AT&T Labs - Research Message-Id: <1058455592.1492.73.camel@squeak.research.att.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.4 Date: 17 Jul 2003 11:26:33 -0400 Content-Transfer-Encoding: 7bit X-Loop: caml-list@inria.fr X-Spam: no; 0.00; mff:99 camlparam:01 camllocal:01 callbackn:01 camlreturn:01 stub:01 recognizes:01 compiler:01 fernandez:01 idl:01 typedef:01 caml:01 camlidl:01 closure:01 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk Thanks to everyone who has helped us with earlier questions. We have 2 new questions regarding use of the Caml IDL. Our Caml application is unusual in that the Caml app calls C functions, which in turn may call Caml functions that return Caml objects to C, which in turn return those Caml objects back to the Caml app. 1. It is not clear how to use the CamlIDL type syntax to define the type of a Caml value that will be returned from C. We tried: typedef [abstract] value CamlObj CamlObj c_function() assuming that on the C-side, the type of a caml object would be represented by the type value (as defined in caml/memory.h) But this does not compile. Is it possible to express such a type? 2. Assuming we can specify the above type, the c_function that calls back into Caml will look something like this: CamlObj c_function() { CAMLparam0(); CAMLlocal2(caml_obj, args); ... Usual set up to get pointer to Caml function and allocate space for args ... caml_obj = callbackN(*caml_function_closure, 0, args) CAMLreturn(caml_obj); } Because c_function will be called from the IDL stub functions, do we have to modify the stub functions to follow the same function-call protocol as above? Unless the IDL compiler recognizes that c_function is returning a Caml object, I am assuming that we do. One point: the caml_obj is only propogated back to the Caml app, i.e., there is never a pointer from the C heap to that object. Thanks a lot! Mary -- Mary Fernandez AT&T Labs - Research ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners