Ordering, nil < false < true < xxx. Would that make sense ?

  • Thread starter Jean-Hugues ROBERT
  • Start date
J

Jean-Hugues ROBERT

Hi,

While implementing some Prolog like matching with free/bound values
I ended up defining: Free < Bound (something free is less than something
bound).

I was wondering if something similar would make sense also for the ordering
relationship of false/true and potentially nil too.

Assuming nil means "nothing".

That nil is less than something seems rather intuitive.
That something false is slightly more than nothing seems intuitive too.
And that something true is more than something false...
And that something more than just true is more than just true...

OTOH I don't like the idea that 1 + nil would be equivalent to 1 + 0
because addition already defines "nothing", it is zero. Idem for
for "x" + nil, because concatenation defines "" for that.

OTOH, that both false and nil are false today is really convenient.
Are there nice languages where nil is less than anything else ?

Yours,

Jean-Hugues
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,174
Latest member
BlissKetoACV
Top