[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: pass by value of lua function arguments
- From: Rob Kendrick <rjek@...>
- Date: Fri, 9 Mar 2012 20:51:20 +0000
On Fri, Mar 09, 2012 at 03:44:38PM -0500, cynthia powers wrote:
> How does one achieve pass-by-value of lua functions arguments?
Numbers and bools and nil are essentially passed by value. Strings,
because they are immutable, can be considered this too. Tables,
userdata and such which are always passed as reference cannot be passed
by value. You can emulate by-value passing of tables by doing a copy of
them. Deep or shallow is up to you, depending on the data structure.
B.