[PD-dev] First attempt at "list" object uploaded

Guenter Geiger geiger at xdv.org
Mon Jul 25 12:35:59 CEST 2005


On Mon, 25 Jul 2005, Frank Barknecht wrote:
> > If there would be a dollar argument that takes a whole list, this
> > could be solved very elegantly, like:
> >
> > [set $@(
> >
> > just builds a message that starts with set and then comes the list.
>
> Well, a float atom just accepts one single argument anyways, so $@ is
> not needed in that case.

I know, I was not talking about that, but about the original problem of
dynamically generating messages. Sorry if that was not obvious.

Let me explain:
In order to convert lists to messages I normally use message boxes with
$ arguments. E.g if I send a list "foo 2" to  [set $1 $2( it will
construct a message that reads [set foo 2(,
similar with a 3 element list and $1,$2,$3.
Now, my proposal is to introduce a $@ dollar symbol which accepts
lists of any length, this way it is not necessary to know the
length of a list before converting it into a message.
Hope this makes it clearer.

Cheers,
Guenter

>
> Generating arbitrary length "set" messages is possible with [list
> prepend set]---[list trim] or [route list]. The $@ however could be
> useful if you want to use "send-messages" like for example:
>
>   [list with unknown length(
>   |
>   |           [f $0]
>   |           |
>   |           [makefilename pd-%d-subpatch]
>   |           |
>   |           [list $1(
>   |           |
>   [list prepend]
>   |
>   [;
>   $1 obj 10 10 myobj $@ (
>
> I don't see a way this can be done except by using something like
> [send13] or [sprinkler], however often there are some other ways to
> work around a problem like this anyways (e.g. "add2" and "list
> serialize").
>
> Ciao
> --
>  Frank Barknecht                               _ ______footils.org__
>
>           _ __latest track: "plak" @ http://footils.org/cms/show/44
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev
>







More information about the Pd-dev mailing list