[PD] Named arguments for abstractions

Roman Haefeli reduzent at gmail.com
Fri Oct 24 10:56:09 CEST 2014


On Thu, 2014-10-23 at 21:47 -0700, Jonathan Wilkes via Pd-list wrote:
> I think we're talking about the same thing.
> 
> 
> In matju's scheme, the abstraction author can make it possible for a
> user to type something like this:
> [myabstraction, something 1 2 3, something_else blah]
> 
> 
> After the objects inside myabstraction are instantiated, it would
> output this from the leftmost inlet inside the abstraction:
> something 1 2 3
> something_else blah
> 
> 
> Then the abstraction author can [route something something_else] in
> order to use those messages to initialize whatever they want inside
> the abstraction.  I assume this is what would happen in your scheme
> after the final [route bang] to the outlet at the end of the patch.
> 
> 
> In fact you can do this in Pd Vanilla and obviate the symbol
> parsing/conversion.  Try this:
> [named-arguments foo bar, height 12, cats miaow look ma an arbitrary
> number of values for this last named "arg"]
> 
> 
> 
> Break the list into sequences using [sel,].  It works because Pd's
> parser converts the comma atoms to symbols consisting of an escaped
> comma.


Quite a few times, I wished so much something like this would be
possible and I didn't even bother to try assuming that something like
'cat meow, hund wau' would be split into 'cat' 'meow,' 'hund' 'wua'. But
as you fortunately showed us, the comma is split separately! That is
really useful to know. Thanks a lot for bringing it up.

Roman
 





More information about the Pd-list mailing list