[PD-dev] $0 in messages, was: multiple $arg-expansion
Hans-Christoph Steiner
hans at eds.org
Sun Jan 15 18:14:45 CET 2006
On Jan 15, 2006, at 4:01 AM, IOhannes m zmoelnig wrote:
> Thomas Grill wrote:
>>
>>> do you mean, is there a reason for my patch, a reason for $0 or a
>>> reason for $0 being "different" in messages?
>> the latter (your patch is great, although i'd like to have even more
>
> well i think this is very consistent: $args in messages refer _only_
> to parameters of incoming messages, while $args in objects refer only
> to parameters of upstream objects. (and $0 is bound to the class
> instance)
>
> however, i think that "$0" is a bad name.
> i would have liked it better if $0 was the selector (in messages) and
> the classname (in abstractions).
> probably "$$" would have been better for a uniq id (well, i know that
> this is a bashism (its the process-id in bash), but that is not
> necessarily bad)
This sounds logical. I have a question about the selector tho. So if
I send [1 2 3(, would the $0 selector be "list" or would it be "1"?
As for implementing this, we could add $$ as the instance ID, and $0 in
messages as the selector. Then have $0 default to classname in
objects, but have a startup flag that reverted $0 to the old behavior
for running old patches. Why we are at it, $# for number of arguments
and $@ for all arguments would be nice too.
>> flexible $args-processing).
>
> this is on my todo-list.
> 1st thing todo (soon!) is to remove the restriction that dollsyms have
> to start with $
Yes, this would be good.
> (while this restriction makes parsing trivial it is cumbersome at the
> best)
> 2nd thing todo (LATER!) is a mechanism for stacked $args, like ${$1-2}
Stacked args would complicate things more than its worth. I think it
is getting away from the graphical nature of Pd programming and I can't
think of any parallel structure in any language that uses $ variables.
Couldn't you just use stacked messages with regular $ args? That would
be much more Pd-ish.
.hc
>> Sorry for continuing in your thread.
>
> better in this thread than never...
>
>
> mfmgasdr
> IOhannes
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
>
________________________________________________________________________
____
"Looking at things from a more basic level, you can come up with a more
direct solution... It may sound small in theory, but it in practice, it
can change entire economies."
- Amy Smith
More information about the Pd-dev
mailing list