Re: Re :Will operator '==' support fulluserdata and number or nil or false

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Re :Will operator '==' support fulluserdata and number or nil or false

奥斯陆君王
All right, even so, I don't find out anything bad  for  adding such a
method. What does it break.

Reply | Threaded
Open this post in threaded view
|

Re: Re :Will operator '==' support fulluserdata and number or nil or false

Dennis Fischer
Glück auf!

In my opinion it would mostly break Luas design; that is, its simplicity. There's lots of languages like Ruby that add an exception or a feature for anything that seems mildly annoying to do as a function instead, and those languages often end up feeling bloated and hard to learn. Lua has kept itself far away from this sort of feature-creep, and it's the main reason I use it in the first place.

Also consider that allowing to override `==` just shifts the problem by one position; now you can have `nil == my_variable` be true, but `if my_variable` still treating it as truthy, because it's not `nil` (but only *equal* to it).

PS: It's 2019, why does email still use HTML+CSS instead of markdown?!