Hallo Jonathan, Jonathan Wilkes hat gesagt: // Jonathan Wilkes wrote:
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.
Ah, indeed you're right! Thanks for pointing me to this, I was falsely assuming otherwise (and should have checked myself before tellling others to check it, sorry. :(
I would prefer the more verbose form [list append $1 $2 ...] just for clarity.
Frank