[PD] dealing with arguments and inlets

Frank Barknecht fbar at footils.org
Sat Feb 4 09:37:58 CET 2006


Hallo,
Hans-Christoph Steiner hat gesagt: // Hans-Christoph Steiner wrote:

> I found one key difference between [any_argument] and [list_argument].  
> [any_argument] outputs a non-symbol, [list_argument] outputs a symbol.  

That's a tricky question: What would a user of these abstractions
expect [*_argument] to output if s/he creates an abstraction with the
argument [myabs foo]? Should "foo" be a "foo" or a "symbol foo"? Both
cases are quite usual, but they look the same from the argument
handling. 

For consistency I would say: If the user wants "foo" but not "symbol
foo" s/he shouold take care of that manually with [list trim].

> So that means that if you want to handle messages like [word( with 
> [list_argument], there will have to be this after it:
> 
> [route symbol]
> |
> [route word]

better would be [list trim].

> Personally, I think its better having the argument not be a symbol 
> since its very likely that [route] will be involved soon after. 

Or [makefilename pd-%s] ;)

> Also, for [list_argument], you'll need some extra logic on the
> convenience inlet to make sure that the output on the [outlet] is
> always consistent.  I attached a version of [list_argument] with
> this extra logic:

> [inlet]
> |
> [route float]
> \         [symbol]
>  \        /
>   \     /
>    \  /
>     [outlet]

If this coercion to a type is wanted, a simple [list] would be better
IMO. 

> This gets into another definition question.  What is the type in this  
> message: [word( 

It's a symbol. Oh, no, wait, it's not, "symbol word" would be a
symbol, or rather, a symbol-symbol. [word( then would be a
non-symbol-symbol. ;)

If you send it through [list] it will always become a symbol-symbol.

Ciao
-- 
 Frank Barknecht                 _ ______footils.org_ __goto10.org__




More information about the Pd-list mailing list