I think a main patch should inherit it's path/lib settings to all abstractions used inside it, unless declared otherwise in the abstraction itself. is there a problem with that? maybe this does not work because abstractions are loaded before the main patch, so the information does not get parsed before abstractions are loaded? but the main patch is always read first, no? wasn't declare meant to declare local namespaces only? marius.
Frank Barknecht wrote:
Hallo, Miller Puckette hat gesagt: // Miller Puckette wrote:
I use 'declare' all the time.. don't think it's semifunctional at all. I think the questions about how declares should act inside abstractions are hard to resolve; in my own usage (and in the way I suggest others might want to use declare) it's always in the main patch, as a way to show the patch what libraries, etc, it needs.
In Pd as I see it there is no inherent distinction between a main patch and an abstraction. Even a patch designed as "main patch" can become an abstraction quickly, for example if I make a toplevel performance patch that loads other "main patches" as abstractions. If [declare] only works in the new main patch, I will have to manually collect all dependencies from the sub-abstractions again, which is tedious, duplicate work, if they all include appropriate [declare]s already.
An open question is how to deal with conflicts, i.e. what to do when the toplevel patch declares "-path /to/zexy/" and an abstration used in that patch declares "-path /to/cyclone" and both try to use [urn] which acts differently in zexy and cyclone.
As many things in Pd are global per default (value, send/receive, arrays, ...) it may make sense to add something like a "-localpath" option to [declare], so that abstraction authors could add their local settings to a canvas, while still accepting toplevel declarations:
"toplevel patch": [declare -path /to/zexy] [urn] <= zexy's urn [abstraction1] [abstraction2]
"abstration1": [declare -localpath /to/cyclone] [urn] <= cyclone's urn [abstraction1a] "abstration1a inside abs. 1": no "declare" [urn] <= zexy's urn, as abs. 1 only uses -localpath "abstration2": [declare -path /to/cyclone] [urn] <= zexy's urn, if main patch declares "zexy", cyclone's urn otherwise [abstraction2a] "abstration2a inside abs. 2": no "declare" [urn] <= as in abs. 2.
But actually I would feel more comfortable if all settings would be local to a canvas. For example "abstraction2a" from above would act differently depending on the toplevel patc.
All local would conflict with your usage so far, though. OTOH it seems [import] tries to be just that (never used it, though): A modifier for the local canvas only, so maybe we can use both?
Ciao