4 ms·
There are some idioms in Lua that you might recognize from Python or Ruby. I have seen this one in Perl and the Bourne shell, as well. ffi = ffi or require("
by gregholmberg 15y ago
There are some idioms in Lua that you might recognize from Python or Ruby. I have seen this one in Perl and the Bourne shell, as well.
ffi = ffi or require("ffi")
If the ffi expression evaluates to something that is not nil, we keep the previous value of ffi. The assignment becomes a no-op.
If it evaluates to a nil, we initialize it by calling require().