I was creating a block called
(all but last of $list ::list) with the definition being
but I ran to a problem when I was modifying a global variable with the value being a list and when I tried that block with the input being the global variable it modified it. Can someone help me?
You can create a deep copy of the list
Also makes a shallow (one level deep) copy of the list.
Here is a tutorial that goes into detail about how this works: Common pitfalls when working with lists (and how to avoid them)
although I think sometimes that is slower than the alternative.
qw23
April 28, 2025, 10:56pm
8
You may leave out the outermost reverse
if the order of the elements doesn’t matter.
I haven't actually tested the speeds of these options, but just throwing this out there.
(item (numbers from (1) to (([length V] of (list)) - (1))) of (list)) // works for length > 1