caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] [Lablqt] Map C++ classes to OCaml
@ 2011-10-10 11:30 Kakadu
  0 siblings, 0 replies; only message in thread
From: Kakadu @ 2011-10-10 11:30 UTC (permalink / raw)
  To: Caml List

[-- Attachment #1: Type: text/plain, Size: 1195 bytes --]

I'm going to implement inheritance of C++ classes in lablqt and I'm
prototyping test example<https://github.com/Kakadu/lablqt/tree/master/inher>.


Main idea is to wrap C++ classes by some another class, where all public
methods are replaced on calls of caml methods (of course, any this wrapper
classes has a pointer to OCaml object). When some method is called, OCaml
code run and if this method was overriden then caml code runs, else runs
call of C++ method.

Known problems are:
1) test example crashes when it trys to call overriden method (it seems that
it can't find it in table of virtual methods)
2) there are some problem if we try to override non-virtual methods. for
example

class A {
public:
  void foo() { boo(); }
  void boo() {}
};

If we override boo(), initial boo() wil be called ofter calling foo().
3) Maybe will be some difficulties with overriding protected meths.... If
problems are not obvious I'll describe them later.

Btw, I've heared that there was same problems with creating binding for
OClosure, but I've not understanded their realisation yet.

I'll be glad if you can formulate more problems or recommend some solutions
of some problems.

Best wishes,
Kakadu

[-- Attachment #2: Type: text/html, Size: 1788 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-10-10 11:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-10 11:30 [Caml-list] [Lablqt] Map C++ classes to OCaml Kakadu

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).