lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]



Does this also mean, that I can reassign 's' as in the code below:

	for s in string.gfind(..something..) do
		--
		if ..sometest.. then
			s= "override"
		end
		print(s)
	end

Currently, this is a 'no-no' and the consequences are sometimes hard to see (most likely, the loop just quits?)

-ak


16.9.2004 kello 02:13, Rici Lake kirjoitti:

 Although undocumented, it also means that the index variable can be
reassigned within the loop without changing the loop -- in 5.0, this
behaviour was "undefined". (Whether it will actually be defined in
5.1 is yet to be seen, but it is sometimes useful.)