Louis idioms compiled in one place

I use Lua for some of my applications. I am looking for a central repository of Lua idioms because I don't want to write C in Lua.

A few examples that I came across are as follows:

x = x or v 

This sets the default value for x, if not already set.

Another is

 x, y = y, x 

to exchange two variables.

+4
source share
3 answers

These links have a whole bunch of useful snippets and idioms:

http://lua-users.org/wiki/SampleCode

http://www.luafaq.org

+2
source

Lua Patterns, Tips and Tricks here, on stack overflow, is also very well read.

+2
source

Try http://lua-users.org/wiki/LuaDirectory - this and the Lua / PiL manual are probably your two best resources in this regard.

+1
source

Source: https://habr.com/ru/post/1336731/


All Articles