[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Apr 2 18:40:36 2002 
Subject:Re: external C call 
From:Aaron Sloman See text for reply address 
Volume-ID:1020402.04 

[To reply replace "Aaron.Sloman.XX" with "A.Sloman"]

Michael H Lees <mhl@cs.nott.ac.uk++> writes:

> Date: Tue, 02 Apr 2002 18:56:41 +0100
> Organization: ACS, The University of Nottingham
>
> Jonathan L Cunningham wrote:
>
> > ....
> >extern "C" int foo(int x);
> >
> >and then you can compile the .cc file as C++.
 
> I do need C++ so this is useful thanks. I know this may be wishful
> thinking but I'm hoping to return a class instance from C++ to poplog
> would this be at all possible? Has anyone ever tried it?

I have never used C++ but I have been told that the only way to get
pop-11 to communicate with C++ is via C.

So if you can get C to interpret a C++ instance as a C
datastructure, then tell Pop-11 what sort of object it is, then
you can perhaps do what you want -- maybe, depending on what you
want Pop-11 to do with the instance.

Storing it somewhere is one thing (see REF EXTERNAL_DATA).

Attempting to invoke C++ methods from pop-11 is probably out of the
question. As far as I know nobody has implemented an interface
between Pop-11 and C++ and I have been told it would be extremely
difficult to do.

So you'll probably have to use C procedures to provide the
interface.

If you come up with a generalisable solution, it may be worth
documenting and adding the information to the poplog web site.

Aaron
====
Aaron Sloman, ( http://www.cs.bham.ac.uk/~axs/ )
School of Computer Science, The University of Birmingham, B15 2TT, UK
EMAIL A.Sloman AT cs.bham.ac.uk   (ReadATas@please !)
PAPERS: http://www.cs.bham.ac.uk/research/cogaff/ (And free book on Philosophy of AI)
FREE TOOLS: http://www.cs.bham.ac.uk/research/poplog/freepoplog.html