[PD-dev] [ pure-data-Patches-1543850 ] $@ and $# expansion (argc, argv)
IOhannes m zmoelnig
zmoelnig at iem.at
Wed Aug 23 09:46:25 CEST 2006
>> Comment By: Hans-Christoph Steiner (eighthave)
> Date: 2006-08-22 18:21
> Yes! This is great!
> As for the selector, $0 is not taken in message space, so I
> think it makes sense there. Since message expansion
> variables are already different than object arguments, I
> think that won't be too confusing. Plus the $ variable
> syntax comes from shell scripting, where $0 is basically the
> selector of the message that is the command line arguments.
i don't agree.
if pd was bash, $0 would be the selector (or object name); $1,... would
be the numbered arguments (as they already are); in bash, $$ is the
"process id", which could roughly map to the canvas id in objects (what
is currently $0)
however, pd is not bash.
$1 in object boxes and messages boxes has the same meaning in a
different context. (i know this is kind of a weak argument since it
derives the idea from the implementation, but: on the C-level of pd, the
entire expansion thing is handled by one function; there is no
separation between objects & messages)
$0 has a meaning in objects (which is unfortunately not consistent with
$1), but no meaning in messages.
this does not mean, that we are free to use it for whatever we want.
for me the selector of a message is structurally the same as the object
name (the "selector" of the object), therefore they should have the same
since $0 is taken (for good or bad), we have to find an alternative, (if
we really think we need a selector-expansion).
a meaning for $0 in messages could be a "timestamp". ("objects" are
"images", spatial entities; contrary, the basic property of "messages"
is there position in time; so arbitrary messages could be grouped
together bythis property: messages at the same moment have the same $0)
More information about the Pd-dev