lua-users home
lua-l archive

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


Hello Shmuel,

Monday, November 20, 2006, 5:51:55 PM, you wrote:

SZ> The most common way to do it in Lua is to make foo return the modified
SZ> values, e.g.:
SZ>      var1, var2 = foo (var1, var2)

SZ> (Also, if  var is a table then its contents can be modified inside foo).

This is the way I'm doing it currently, and was thinking that maybe there's a way to avoid the assignment upon returning from the function.

SZ> See this thread:
SZ> http://lua-users.org/lists/lua-l/2006-11/msg00155.html

>From what I understand, this was in previous versions and has been removed. I had no idea of that. I'll stick with gsub then, as using metatables would slow me down a bit (more code around the gsub call).


PS: I have auto-wrapping set at 70 characters, which kicks in when writing a mail and I never noticed the mails arriving unwrapped on the list until mentioned. I'll check my settings.

-- 
Theodor-Iulian Ciobanu
jr Virus Researcher

e-mail: tciobanu@bitdefender.com

-----------------------------------------
Trying to secure your every bit
-----------------------------------------


--
This message was scanned for viruses by BitDefender for Linux Mail Servers.
For more information please visit http://www.bitdefender.com/