[Pyrex] ANN: pyrexembed - Pyrex C++ wrapping kit
Lenard Lindstrom
len-l at telus.net
Tue Nov 8 23:33:27 CET 2005
On 9 Nov 2005 at 8:44, David McNab wrote:
> Lenard Lindstrom wrote:
> > Pyrex already handles many aspects of C++. Here is the web site
> > example written in pure Pyrex:
>
> ehh? where on the website is that?
>
I translated the pyrexembed example. It is adapted from a proof-of-
concept example I included with the first C++ patch.
> > cdef extern from "MyClass.h":
> 8><
>
> I assume this requires the C++ patch.
>
Yes. But the patch only makes Pyrex generate C++ compatible C code.
It changes nothing of the Pyrex language itself.
> Anyway, after sleeping on pyrexembed, I'm now seeing that it could be
> used as a convenience system when wrapping plain C as well, since it
> eliminates the need to write and maintain 'cdef extern from' and
> 'ctypedef' blocks.
>
> If I get a chance this evening, I'll update pyrexembed to allow users to
> specify generation of pure-C layer generation (with default staying as C++).
>
I noticed it was a general purpose tool.
> > Of course 'pyrexembed' could simplify things when C++ exception traps
> > must be written. I'm still not sure how best to do this.
>
> It does give a mechanism making it easy for users to access all of C++'s
> features, so until Pyrex gets full C++ support, pyrexembed will have
> some usefulness.
>
It is useful. Embedding C++ code is convenient.
Lenard Lindstrom
<len-l at telus.net>
More information about the Pyrex
mailing list