From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 62CC9BB83 for ; Sun, 13 Aug 2006 22:44:04 +0200 (CEST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by nez-perce.inria.fr (8.13.6/8.13.6) with SMTP id k7DKi3Jo027918 for ; Sun, 13 Aug 2006 22:44:04 +0200 Received: (qmail invoked by alias); 13 Aug 2006 20:44:01 -0000 Received: from p54A339F2.dip0.t-ipconnect.de (EHLO localhost) [84.163.57.242] by mail.gmx.net (mp041) with SMTP; 13 Aug 2006 22:44:01 +0200 X-Authenticated: #20477425 Date: Sun, 13 Aug 2006 22:47:15 +0200 From: micha To: caml-list@yquem.inria.fr Subject: question about how to bind c++ classes to ocaml Message-ID: <20060813224715.0769efc9@localhost> X-Mailer: Sylpheed-Claws 2.1.1 (GTK+ 2.8.18; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at nez-perce with ID 44DF8F13.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; ocaml:01 ocaml:01 allways:01 functions:01 variables:02 variables:02 native:02 binding:02 binding:02 implement:06 classes:07 function:08 bind:08 everytime:08 michael:08 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 when binding an ocaml class to a c++ class, what's the preferred way to access member variables of the c++ class? One is just to implement the get and set function in ocaml to call the native get/set functions of the c++ class. That way you allways have some calls from ocaml to c only to get a value of a c++ object. Another way would be to add similar member variables to the ocaml class and everytime the c++ side changes a member it updates the ocaml side too (through direct access). This way you have an additional binding (the c++ object knows it's ocaml object), but you can access the member variables in ocaml through normal ocaml methods. any comments? thanks, Michael