[C++-sig] Boost.Python code generator

Nicodemus nicodemus at globalite.com.br
Thu Dec 5 04:19:52 CET 2002

David Abrahams wrote:

>Why invent such radical new syntax? It's neither C++-like nor
>Python-like Wouldn't 
>       virtual void foo(int);
>work better?
Hello David,

Because it would break the C++ syntax in other cases. The simple "def" 
would have to change too, since now the user has to declare types:

Instead of:

    def bar

The user would now have to write:

    void bar(int x, double y, float z);     

To maintain consistency.

Also, I want to add some other directives, like for example "rename", 
which lets the user rename a function. How do that in a syntax similar 
to C++?

    void bar(int x); rename MyBar;

Seems weird, most likely to confuse.

    void bar(int x); // rename MyBar

would be better, maybe.

My idea is to include in the interface *only* the minimum that boost 
needs to generate the wrapper code. Using a different and consistent 
interface, seems to me a good idea in this case.

But the objective of my post is to discuss the idea... the 
interface-file syntax is not definite, and will likely change.

Best Regards,

More information about the Cplusplus-sig mailing list