7

I'm developing a plugin for Oxide 2. I've been learning from other plugins and I've noticed that some of them use null instead of nil. For example:

if args[1] == null then

Oxide 2 is written in C#, so I assume that null is defined in C# or in Lua Interface.

Is there any difference between them?


Update: I've somewhere read that it can be used for check, if MySQL column is NULL. Is that true?

4

1 回答 1

16

nil是 Lua 语言中的一个值。

null是一个变量名。它包含什么价值?您可以轻松检查。我们不可以。如果结果是nil,那么 usingnull是没有意义的,可能是某人在 C# 和 Lua 代码之间切换上下文时犯的错误,因为未定义的变量将评估为nil.

于 2015-07-09T17:02:15.800 回答