[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Computer science in Lua
- From: "Joseph Manning" <manning@...>
- Date: Thu, 17 Dec 2015 21:26:00 -0000
On Thu, December 17, 2015 19:31, Evandro Leopoldino Gonçalves wrote:
>> I'm implementing some classical algorithms and data structures in Lua.
>> Maybe it can be useful for someone :D
>>
>> https://github.com/EvandroLG/computer_science_in_lua
Evandro,
There is no need to write a 'swap' function in Lua;
you can just write
a, b = b, a
to swap the values in variables 'a' and 'b'.
This may simplify your code a little.
Joseph
------------------------------------------------------------------------
Joseph Manning / Computer Science / UCC Cork Ireland / manning@cs.ucc.ie
------------------------------------------------------------------------