Hi Frank, I understand what you describe. But when the 1st creation argument is a float, [list $1] and [list append $1] print the exact same result as far as I can see.
(Shaky comp sci terminology to follow...) Looking at list_new in x_list.c, if the first creation argument of [list $1 $2 etc.] is a not a symbol, the object is deemed a [list append] and the args are left alone. For [list append $1 $2 etc.] however, after "append" is matched, the argument count is decremented and the 2nd arg becomes the 1st. Consequently, the behavior of [list $1 $2 etc.] is exactly the same as [list append $1 $2 etc.] in this case.
-Jonathan
--- On Sun, 3/22/09, Frank Barknecht fbar@footils.org wrote:
From: Frank Barknecht fbar@footils.org Subject: Re: [PD] ADSR variations [was: Re: Patch-off] To: pd-list@iem.at Date: Sunday, March 22, 2009, 12:27 PM Hallo, Jonathan Wilkes hat gesagt: // Jonathan Wilkes wrote:
Actually [list $1 $2 $3 $4 $5] seems to work in this
context, but I guess
that's because the first arg isn't a symbol.
Is that why you're saying [list
append] is needed?
The [list] object will behave differently depending on its first argument: You get to choose between [list prepend], [list append], [list split] etc. The following arguments have different meanings depending on the first argument.
E.g. [list split 3] will split a list at position 3, while [list prepend 3] will add a "3" in front of your incoming list.
If you create [list] without any argument it will be the same as [list append], but if you'd use [list $1] then the value of $1 will decide, which kind of list operation you get. So if $1 is "split" you get a splitter, if it's "append" then you get a [list append].
So [list $1 $2 $3 $4 $5] is *not* the same as [list append $1 $2 $3 $4 $5]! Try it by sending something into both and print the result.
Ciao
Frank
Pd-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list