caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* question about how to bind c++ classes to ocaml
@ 2006-08-13 20:47 micha
  2006-08-14  0:20 ` [Caml-list] " Jacques Garrigue
  0 siblings, 1 reply; 5+ messages in thread
From: micha @ 2006-08-13 20:47 UTC (permalink / raw)
  To: caml-list


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-08-14  8:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-13 20:47 question about how to bind c++ classes to ocaml micha
2006-08-14  0:20 ` [Caml-list] " Jacques Garrigue
2006-08-14  7:04   ` Jonathan Roewen
2006-08-14  7:17   ` Michael Wohlwend
2006-08-14  8:45     ` Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).