lua-users home
lua-l archive

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

On Mon, Dec 7, 2020 at 8:47 PM Egor Skriptunoff
<> wrote:

> Yes, nil is a semantically special value when used in Lua tables.
> Does this mean that Lua should have performance problems when using it?

You have not demonstrated that using nil as intended is a performance
problem. You have demonstrated that good performance in a contrived
example where nil is used for no good reason is not easy.

> As I see, you have chosen the first option - to encourage everyone to use false.

I have not chosen any of those options, I just asked a question. Any I
could rephrase the question with any non-nil values.

> I'm not suggesting to change the semantic role of nil in Lua.

You are suggesting a change that might be beneficial for your
particular contrived example. For the record, it is not obvious at all
that your suggestion would enable much better performance than already
attained. However, there might be another contrived example where it
would not be beneficial. That was the whole point of my message -
contrived examples won't get you anywhere.

Note I am not saying that your suggestion is bad, I am talking about
the way you advocate for it.