question
- Posted by Tone Škoda <tskoda at email.si> Nov 16, 2004
- 520 views
I have a question for how interpreter does its internal things. Example:
function f () return {1, "large data"} end function procedure main () sequence tmp sequence data tmp = f () data = tmp [2] data = append (data, "something") -- If I assume correct previous line had to make -- a copy fo "large data", which would slow things down, -- and there are now two copies of "large data", -- one in 'tmp' and one (modified) in 'data'. -- -- Would it be better and faster if after line -- data = tmp [2] -- I would do this: -- tmp = {}? end procedure