[C++-sig] Problems with Pyste from CVS.

Nicodemus nicodemus at globalite.com.br
Fri Jul 4 01:55:30 CEST 2003


Hi Prabhu,

Prabhu Ramachandran wrote:

>I found a _minimal_ test case that has triggers the problem for me.
>
>// --------------------
>namespace test {
>
>class A {
>public:
>    A() {}
>    int _name;
>};
>
>}// namespace test
>// --------------------
>
>Further testing shows that its the '_name' thats causing problems.  I
>change that to '_nam' and it works!  Wierd.  Besides, it has to be a
>data or member function of the class.  A normal function with name
>_name works fine.
>  
>

Yep, as I feared. 8(

I have been doing some internal changes to Pyste to support 
meta-programming, and my plan was to allow the user to access 
information about the declarations using "_" to acess the attributes:

namespace test {
    struct C
    {
        void Foo(const int, double);
    };
}

----

C = Class('test::C', ...)
print C._name   # prints "C"
print C._FullName()  # prints "test::C"
print C.Foo._parameters[0]._FullName()  # prints "const int"


And so on. But of course, it didn't occur to me that the attributes of 
the objects would get in conflict with the declarations. Well, duh!

Anyway, I will reverse this changes, since they clearly don't work. I 
have to find a way to allow the user to access the attributes, and what 
I've thought so far is providing access to them using operator []:

print C['name']
print C['fullname']
print C['parameters'][0]['fullname']

But I think it makes the syntax confusing... 8(

Any one has any ideas? They are most welcome.

Regards,
Nicodemus.





More information about the Cplusplus-sig mailing list