[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Empty? No. Array? No. Has? Yes.
- From: Coda Highland <chighland@...>
- Date: Wed, 3 Jul 2013 15:12:32 -0700
On Wed, Jul 3, 2013 at 2:45 PM, Eike Decker <firstname.lastname@example.org> wrote:
>> It's a brilliant idea, but is "nil" an alias for "nil(defined)" or
>> "nil(undefined)"? It'd have to be an alias for "nil(undefined)" to
>> avoid breaking "t[#t] = nil" and similar idioms.
>> /s/ Adam
> If you write "nil", you specify it, so it's nil(defined). The
> undefined nil value is only created when it originated from a lack of
Sadly I can't see any way to reconcile "nil" = "nil(defined)" with
"t[#t] = nil" being a pop operation. It would be a
backwards-incompatible change, and therefore can only be an opt-in
behavior, which is of course an increase in complexity.
If "nil" = "nil(undefined)" and "null" = "nil(defined)" then it works,
at the cost of adding another keyword, but Roberto seems to indicate
that doing so would require some additional hierarchy of values. I
don't think I understand why.