inserting an element in a list at position n

Maa's icon

my case is even more simple (position is 2)

1/ I don't see how to do it simply
2/ I am searching for a fast / efficient way to use it at low level

Thanks in advance

Léopold Frey's icon

Sorry, it's completely wrong.

Max Patch
Copy patch and select New From Clipboard in Max.

[zl nth] is more appropriate.

leo

Maa's icon
Max Patch
Copy patch and select New From Clipboard in Max.

still wrong you are doing a replace
here a good one ( slice join join ) but too complex

Maa's icon

from your I simplified mine
I don't know what the most efficient one (depend on zl implementation)
but I'd like better (in term of CPU)

Max Patch
Copy patch and select New From Clipboard in Max.

Thanks

Léopold Frey's icon

oups,

next time I'll read the first word of the post twice.

For the most efficient one, I don't know, repeat 2000 times the operation (uzi) and compare cpu time (see cpuclock helpfile)

léo