[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Alternative to ~= for inequality?
- From: Matthew Frazier <leafstormrush@...>
- Date: Thu, 7 Mar 2013 18:53:47 -0500
On Mar 7, 2013, at 17:27 , Rena wrote:
> On Thu, Mar 7, 2013 at 9:32 AM, Gavin Kistner <phrogz@me.com> wrote:
>> On Mar 6, 2013, at 10:01 PM, Miles Bader <miles@gnu.org> wrote:
>> Python's "<>" for inequality is also strange to me, but not as strange as "~=".
>
> "<>" is different but makes perfect sense from a logical standpoint:
> "less than or greater than", i.e. not equal to.
This logic only holds when the elements being compared have a well-defined ordering. Numbers are ordered by definition, and strings can be ordered lexicographically, but nils, booleans, tables, userdata, functions, and threads don't have a meaningful ordering (except through metatables).
Thanks,
Matthew Frazier
http://leafstorm.us/