[PD] what is a list? (symbols vs. floats)

Hans-Christoph Steiner hans at eds.org
Sat Mar 20 04:37:07 CET 2004


On Friday, Mar 19, 2004, at 12:04 America/New_York, Mathieu Bouchard 
wrote:

>
> On Sun, 14 Mar 2004, Hans-Christoph Steiner wrote:
>
>> [list 1 2 3( is a list
>> [1 2 3( is a list
>> [list one two three( is a list
>> [one two three( is NOT a list
>> [one 2 3( is NOT a list
>> [1 two three( is a list
>> Ok, I can see that anything that starts with a float is automatically
>> deemed a list, while anything that starts with a symbol is
>> automatically deemed not a list unless cast as such.  This is
>> confusing and I don't see the benefit.
>
> A message has two parts, a selector and an argument list. it's like a
> function call: "list 1 2 3" does something like call list(1,2,3) in the
> context of an object and inlet. However, a selector must be a symbol, 
> and
> if it's not, then Pd has to fake it and pull something from somewhere. 
> So
> the rules are:
>
>   single float messagebox -> selector "float"
>   multi-element messagebox starting with float -> selector "list"
>   any messagebox starting with a symbol -> selector is that symbol
>
> In addition there are fallback rules so that if the function is not
> defined, other calls are attempted. e.g. selector "float" vs 
> single-float
> list.
>
> Well, that's what I think it is... looks rather simple to me.
>
> However, the docs may be a bit confusing wrt selector-vs-arguments
> distinctions, and may call a selector a "first argument"... sigh
>
> (Hey. I wrote all of this message days ago. And then I forgot to send
> it. Silly me.)
>

Right, to reiterate, I understand what is happening, but I am wondering 
why.  This set up makes handling mixed symbol/float messages in a 
general way more difficult and I don't see the benefit of this system.  
I am a big fan of "as simple as possible, but no simpler".  I am 
wondering if this could be simpler.

I have started making patches that illustrate confusing message 
behavior with the aim of hopefully smoothing some out, or at the very 
least documenting them well.  I would like to use lists in this way, 
but I find I mostly use [prepend]s with message handling because they 
are simple and general to all message types.  But it always feels like 
I am cheating a bit, like there should be a better way.

.hc





More information about the Pd-list mailing list