Open Freakwill opened 5 years ago
This is the ordinary logic of Lua; setting a variable to nil
is the same thing as never setting it in the first place.
So there's no difference between z = nil
(and z = t[x]
on an empty t
is just a fancy way of saying z = nil
) and not setting z
in the first place. In both cases, the failed lookup on _G
triggers the __newindex
patch, causing a shell function to be returned.
Let's see the following code. whenever a variable is nil, it will be a function if import
sh
.I forgive the first one, since x may be set to be a function by
sh
, but how to explain next two?