[PD] $n expansion inconsistency with arrays

Alexandre Torres Porres porres at gmail.com
Tue Apr 21 02:06:53 CEST 2020


Hi, we've been discussing this on github and agreed we need to get more
voices involved here in the list.

I've found an inconsistency where arrays (inserted via the put menu or
shortcut) will not expand "$n" variables in their names ($0, $1, $2, etc...)

Nonetheless, if you have an object like [table $0-x] or [array define
$0-x], when you click on these objects to open a subwindow containing an
array, you'll see these do expand dollar symbols.

Moreover, the norm in Pd seems to be expand dollar symbols in general.
Labels in atom boxes and iemguis will show up expanded. When you open a
subwindow with such variables, they are expanded and shown inside
parenthesis in the top of the window. And, above all, messages that come
out of objects (like [symbol $0-x]) will get expanded in the output.

There's only one difference between "$0" and "$1/2/3...". While a "$0" is
always given, be it an abstraction or not, the others need to be passed as
arguments to an abstraction. As such, when you have an abstraction without
these arguments, or if opened as a top level patch (not loaded as an
abstraction), these variables are not expanded. In short, "$0" is always
present and expanded, and others are only expanded if given. I'm not
counting this difference as an inconsistency, as there's a good reason for
the different behaviour.

As far as the array inconsistency, $1 will generate more confusion. An
[array] or [table] object will have an array that shows an expanded name or
not, depending wether you have that argument or not, while an array
inserted via the put menu or shortcut will never expand it.

It makes sense to me we should make things as consistent as possible and I
don't see the point why the array has this inconsistent and different
behaviour. For some reason, it behaves like objects, and I don't see it
closely related to objects. By looking at [array] and [table], which are
indeed objects, I can see it makes total sense - you can check the
unexpanded symbols in the objects' arguments, and check the expanded
message in the array name. If, for some reason, checking unexpanded symbols
for arrays is useful for you (I can't see why*), you can always use such
objects.

* an array name that looks like 1003-x is clearly an expanded symbol from
"$0", if you're loading an argument symbol into an array name, it's bad if
you can't see it and just see "$1-x" instead.

Anyway, what do you people think?

I'm hoping to request a fix for this inconsistency, hopefully for allowing
"$n" get expanded in arrays inserted via the put menu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20200420/bac0f379/attachment.html>


More information about the Pd-list mailing list