On Mit, 2016-01-20 at 00:49 +0100, IOhannes m zmölnig wrote:
On 01/19/2016 11:45 AM, Roman Haefeli wrote:
IOhannes is correct in that "-lib" behavior hasn't changed (I just tested with 0.45). Considering this, it's probably wise not to change it now, although I feel more sympathy with the use case you described. I don't see anything wrong with having to use [declare -stdlib zexy -lib zexy] in case I want to cover both, relative to calling patch and all standard paths.
so what to do now? there are a few ways to implement the dont-search-stdpath behaviour (starting from a trivial two-liner), and i'm willing to provide one in order to keep everybody happy.
nevertheless here's some things to consider:
- backward compatibility (since it seems that no known version of Pd had
the dont-search-stdpath behaviour)
- consistency with startup flags ("pd -lib foo" will search both the
"-path" paths and the standard paths)
- iictc it's fairly trivial to make it very likely that a library is
loaded only from a patch-local directory, even if "-lib" does search the stdpath:
[declare -lib byzantium2016/zexy]
while this will try to load "/usr/lib/pd/extra/byzantium2016/zexy/zexy.pd_linux", chances are rather low that this actually exists and so it will happily only load the türkçe zexy besides the patch. but of course this is rather a hack...
Zexy is actually a good real-world test case, once because it comes as two different flavors (extended one-object-per-file style, and as multi-object lib), second because the multi-object library is mixed with some abstractions. In order to load the full library, you need to specify a path and a lib. Not that this example makes any sense in the real-world, anyhow one could load zexy like this: [declare -stdpath zexy -lib zexy]. If zexy is installed in a standard path, the patch loads the full library and [dirac~ ] and [cart2sph] can be instantiated. If, however, zexy is installed near the patch, [dirac~ ] instantiates and [cart2sph] does not.
Hm.. I don't know actually, what I'm trying to illustrate here other than that things are complicated.
Isn't it a flawed design that the patch author has to know the packaging style of the library their patch uses? Shouldn't it be sufficient just to _name_ the dependency without having to know whether is a path, a lib, a combination? Something like [declare -std zexy -local my_included_lib] ? Just thinking loud here...
Roman