lua-users home
lua-l archive

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


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
------------------------------------------------------------------------