[PD] using namespace prefixes in a vanilla setup

Hans-Christoph Steiner hans at at.or.at
Sat May 2 03:31:54 CEST 2009


So after a little chatting with Cyrille, and looking thru lots of
various issues in deploying projects, I came up with something that I
think is a solution for including libs like list-abs, mapping, etc. as a
folder then using namespace prefixes (something that has been supported
for a very long time in all versions of Pd).

Basically, one reason to include a library of abstractions with a
project is to make sure that the project will continue to work on new
versions of Pd and in many people's different installs.  One key thing
is getting the right code when you load an object with a name.  For
example, when you type [scale], and you get the one you want.  One key
problem here is that binaries will always override abstractions.  So if
you make an abstraction called threshold.pd in your project, and
someone's install or some version of Pd includes a 'threshold' binary,
you will not be able to load your threshold.pd in anyway on that setup.

So if you use a namespace prefix, then the binary would have to be in a
folder of the same name and have the same name in order to prevent the
abstraction from loading.  So the question I wanted to answer was an
easy way to support using folders for namespaces while including the
library with the project.  So here's the solution i came up with, you
make a 'lib' folder in your project, stick the libraries as folders in
'lib', then use [declare -path lib].  Here's an example:

http://puredata.info/Members/hans/vanilla_libdir.tar.bz2

.hc




More information about the Pd-list mailing list