[PD] import vs namespace

marius schebella marius.schebella at gmail.com
Tue Apr 8 15:22:47 CEST 2008

as far as I understood [import] is the same as [declare -lib] and that 
only adds a library to the local namespace of a patch. see the help file 
for declare that comes with 0.41.
you can declare your library relative to pd [declare -stdlib] or 
relative to the patch [declare -lib], but - as mentioned in the helpfile 
- the name stdpath is confusing!].
it is also not 100% clear, how this works in abstractions and if the 
behaviour will be consistent with future pd versions.
there might be a chance that [import] really adds to the global 
namespace, but I don't think so. (otoh I don't know how to add something 
to the global namespace.)
the idea was that you can use a certain objectclass in one patch and 
another one with the same name (but from another lib) in another patch.
please correct me, if I'm wrong.

Derek Holzer wrote:
> Hi all,
> it seems that the ways of dealing with externals and paths is always in 
> flux! I would like to confirm a suspicion that, for the time being, the 
> following works the way I think it does, assuming PD 0.39:
> [library/object] imports that specific object into global namespace, and 
> can accommodate different objects with the same name from different 
> libs. This method does not allow access to help patches or abstractions 
> in the library path.
> [import library] imports the whole library into global namespace, 
> including help patches and other abs (usually, although I have often 
> found this broken in Extended). It cannot accommodate different objects 
> with the same name from different libs, as the last library imported 
> will have priority.
> Is this correct so far? Has anyone documented this any more 
> substantially anywhere? How does this change for 0.40?
> best!
> d.

More information about the Pd-list mailing list