On Tue, 2011-09-20 at 13:19 -0700, Jonathan Wilkes wrote: > > ----- Original Message ----- > > From: Hans-Christoph Steiner <[email protected]> > > To: IOhannes m zmoelnig <[email protected]> > > Cc: [email protected] > > Sent: Tuesday, September 20, 2011 11:46 AM > > Subject: Re: [PD-dev] removing path and libs from Pd-extended preferences > > GUI > > > > On Tue, 2011-09-20 at 09:31 +0200, IOhannes m zmoelnig wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- > >> Hash: SHA1 > >> > >> On 2011-09-19 19:32, Hans-Christoph Steiner wrote: > >> > > >> > Hey Miller, > >> > > >> > I actually think this would make switching between vanilla and > > extended > >> > easier because it would make people use [import] or [declare] to load > >> > libs, then when using vanilla, you'll know which libraries the > > patch > >> > needs. Can you think of examples where it would make things more > >> > difficult? > >> > >> so the idea is to have tons of error messages when using pd-vanilla, of > >> the kind: "import zexy... couldn't create" so that the user > > knows that > >> they have to load the "zexy" library and henceforth ignore the > > "import > >> zexy" line and only check the remaining "import > > foobar...couldn't create"? > >> > >> i seem to remember that there was a recent email saying that "a patch > >> relying on an error" was not to be considered as correct. > > > > Either way, if you open a patch that uses zexy objects in Pd-vanilla, > > there will be "...couldn't create" errors. Having [import zexy] > > there > > at least gives a place to focus on. Or if people are interested in more > > portability, they are welcome to either use [declare] or "apt-get > > install puredata-import" > > A few questions: > > * What's the difference between [import foo] and [declare -lib foo]? Both > seem to load the library into the patch's local namespace.
Underneath, they are the same thing. I could never remember the [declare] syntax so I wrote [import] and [classpath]. > * Isn't there an issue between loading a lib in the patch's local > namespace and the way the setup routine works globally for a library? > > If I have > > Patch #1 > [import iemguts] > > Patch #2 > [sendcanvas] <- sendcanvas won't load, because its lib was only loaded for > Patch #1 > > But if I have > > Patch #1 > [import iemguts] > [sendcanvas] > > Patch #2 > [sendcanvas] <- this loads, because instantiating [sendcanvas] in Patch #1 > loaded the > lib globally Yes this is true. The namespaces stuff isn't fully implemented yet. The way to guarantee you are getting a specific object is to use the namespace prefix, i.e. [iemguts/sendcanvas]. > Finally: > * why did you develop [import] instead of improving [declare]? Because what I wanted to do would have broken the syntax of [declare], and others wanted it the way it was. .hc _______________________________________________ Pd-dev mailing list [email protected] http://lists.puredata.info/listinfo/pd-dev
