[PD-dev] Re: Fw: [PD] namespaces :: out now

Krzysztof Czaja czaja at chopin.edu.pl
Thu Aug 29 13:54:44 CEST 2002


hi IOhannes and all,

it is a nice code, and takes us one step forward, even if a small
one.  However, if this encouraged people to use names of existing
externs for their redefined versions -- on the ground of ``always
being able to use a qualified name'' -- it would be a very bad
thing, causing confusion, and making many patches hard to reuse...

So, I really do not know, if this is going to be a real step
forward, or just a fuel keeping this thread alive for some more
time?

In the comments below I assume the former...

IOhannes zmoelnig wrote:
...
 > i've made some minor changes to the pd-sources (namely m_imp.h,
 > s_loader.c, m_class.c) to allow namespaces when loading libraries.

please do not call this feature `namespaces'.  From just being
able to use a qualified name it does not follow that we would have
namespaces in Pd -- in the sense of a ``use zexy'' (or similar)
declaration, rules of visibility, etc.

...
 > when the patched pd loads zexy, the primary name of the class becomes
 > "zexy::list2symbol"

in your patch c->c_name and c->c_helpname == "list2symbol" (see below)

...
 > (of course it might not prove optimal, but which solution would be ? i
 > think this is the cleanest solution from a programmers point of view)

ok, but there is a (confused) user's pov too...

...
 > diff pd-0.35-0_namespace/src/m_class.c pd-0.35-0/src/m_class.c
 > 18,24d17
 > < #ifdef NAMESPACE

should be > (-R is needed)

...
 > 207,209d184
 > < #ifdef NAMESPACE
 > <     c->c_name = c->c_helpname = S;

S == "list2symbol", not "zexy::list2symbol"

...
 > 232,240d205
 > <
 > < #ifdef NAMESPACE
 > <     // like a class_addcreator
 > <     if (library_name){
 > <       class_addmethod(pd_objectmaker, (t_method)newmethod, S,
 > < 		      vec[0], vec[1], vec[2], vec[3], vec[4], vec[5]);

please, use ``if (library_name && newmethod)'' here, otherwise
a proxy's name would crash Pd if put in an object box.

Krzysztof





More information about the Pd-dev mailing list