[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: nil semantics in Lua
- From: steve donovan <steve.j.donovan@...>
- Date: Mon, 1 Jun 2009 09:08:58 +0200
On Mon, Jun 1, 2009 at 1:37 AM, Cosmin Apreutesei
<cosmin.apreutesei@gmail.com> wrote:
> I wonder why lua didn't adopted sql-like semantics for nil, i.e. nil
> transcends all types, short-circuits standard operations and
> functions, and nil ~= nil.
One can create a object called Nil and use that. The trouble of course
is that __eq only works on types that are the _same_, irritating but
as observed it would probably slow down comparison for every other
object if this rule was relaxed.
steve d.