[PD] declare vs. namespaces - current best practice

Christof Ressi christof.ressi at gmx.at
Tue Jan 2 20:28:51 CET 2018

> i find [list-abs/list-splat] to be certainly bad practice.

but why?

just to be sure: we're talking about use in libraries. IMHO it's better to be extra careful and add the namespace when possible.

to answer Lucas' question about why both [cyclone/!-~] and [!-~] is working:

looking at the source code, it turns out they have been doing exactly what I just proposed: adding a creator with the prepended library name.

just to give another real world example:
someone writes a library and wants [wrap] from zexy (with the additional second inlet). I'm loading both iemlib and zexy on startup and for some reason iemlib's [wrap] happens to take precedence, breaking the library. the library author doesn't have a chance to force the zexy version.

I think this a big problem - which can be solved by what the cyclone maintainers did. This is not so much important for zexy and iemlib (as they are widely known and a library authors will always try to avoid name clashes with them) but for future libraries. There are so many Pd libraries out there and name clashes are almost guaranteed without some sort of namespacing.

> Gesendet: Dienstag, 02. Januar 2018 um 19:53 Uhr
> Von: "IOhannes m zmölnig" <zmoelnig at iem.at>
> An: pd-list at lists.iem.at
> Betreff: Re: [PD] declare vs. namespaces - current best practice
> On 01/02/2018 07:34 PM, Lucas Cordiviola wrote:
> > Happy 2018 list!!!
> > 
> > IMO [foo/obj] is the “best practice”.
> i find [list-abs/list-splat] to be certainly bad practice.
> i don't think there is one general "best practice" for these kind of
> things (with the current state of affairs).
> > I'm having inconsistent results for single-binary libs (iemlib). Some obj are working and some not. See pic attached.
> > 
> because iemlib, even when compiled as a single-binary is *not only* a
> single binary, but also comes with a number of abstractions.
> with iemlib and some other libs like zexy, but also Gem (which tries to
> do that for you by magicking), the "best practice" is to load both the
> library and add the path and then use the objects without a prefix (aka
> namespace).
> fgmrdsa
> IOhannes
> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list

More information about the Pd-list mailing list