#87 $arg-expansion gives error with old patches

puredata (322)

with the advent of the new and better $arg-expansion
(namely: expansion of $args _within_ an argument, like
bla-$2-blu), old patches (<0.40) that used dollars
within symbols are somewhat broken.

example1: iemlib provides an object [parentdollarnull]
with an alias [parent$0]; the latter gets expanded
(e.g. to [parent1003]) and cannot be created.
however, $0 is not only expanded on a logic level, but
also on a visible level (i really see [parent1003]);
this i believe IS a bug.

example2 (more important!): in the olde times, if a
symbol contained dollars within, it was saved (in the
.pd file) like "bla-$2-blu".
in pd=0.40.0, the same symbol gets saved as
"bla-\$2-blu" (note the backslash).
loading an old abstraction yields an error ("argument
out of range"), even if enough arguments (in this case:
2) are supplied.
the expansion works correctly though!
imho, either the warning should be supressed or the old
behaviour (no expansion) should be preserved.

(it would be good if the pd-version at the time of
saving would be stored in the .pd-fileformat in order
to allow such things)

this little script should replace all "$<n>" with a
missing backslash at the beginning with "\$<n>"

find . -name "*.pd" | while read f
sed -i -e 's|\([^\\]\)\$|\1\\$|g' $f

note on the script: i haven't done excessive testing,
but it seems to work; make backups before you apply it,
since it will change all affected files without asking)

note: it seems like old versions (tested with
pd-0.39-2) seem to be able to correctly read files
saved with pd-0.40-0


  • IOhannes m zmölnig

    example file, written with pd-0.39-2

  • IOhannes m zmölnig

    same file, written with pd-0.40-0

  • IOhannes m zmölnig

    example use of [dollarg_039] and [dollarg_040]

  • IOhannes m zmölnig

    • milestone: 594774 --> v0.40.1
  • IOhannes m zmölnig

    Logged In: YES

    also confirmed with 0.40.1

  • Anonymous - 2006-10-09

    Logged In: YES

    PureUnity uses dollar-expansion in class names, so an
    exception cannot be made for class names, especially because
    PureUnity has no other way to implement its feature set.

    I call this feature "abstraction templates" or "class
    templates": [f.swap], [~.swap], [#.swap] are like
    swap<float>, swap<signal>, swap<grid> would be in C++.

  • IOhannes m zmölnig

    Logged In: YES

    sorry if i was unclear here: dollar-expansion in class-names
    is a feature that i would _hate_ to miss. i think it is
    really important to do any thing more complex. (that is why
    i wrote in HUGE letters that i do not consider this a bug).
    the problem described is rather a bug in the iemlib (it
    shouldn't have used a name like [parent$0] in the first place.)

    however, i do think it a bug, that the classname [parent$0]
    is replaced by [parent1001] (literally!)

    the main bug report here was about pd-0.40 not being able to
    read older patches (created with pd-0.39) without an



Cancel  Add attachments

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks