How to insert an int at a specific index in a list ?
Title pretty much says it all.
Say I have a list of 10 zeroes and I want to add a one at the 2nd position,
how would I do that ?
Also, any recommendations on a elegant way to generate a list of zeros ?
Thank you,
George
If the number of places is known, why not just have a message box with that many zeros in it? At any rate, this is a completely non-general solution to the stated problem:
Hi,
is this what you mean?
Cheers,
Ádám
P.S. My solution assumes that you work with 0-based list counting, so the '2nd element' in this example is the third item of the list.
I think you could work with a jit.matrix object. That would be the easiest way to manipulate a list of numbers.
Another way of creating a list of zeros is to use zl group with uzi sending 0 as a message.
A slice-less version :)
You can also use this feature of [zl nth] -which I like.
Richard
Wow, thanks a lot guys! This is very cool!