[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Is there a reason why __eq, __lt,	__le metamethods enforce returning booleans?
 
- From: Sean Conner <sean@...>
 
- Date: Mon, 17 Sep 2018 17:44:00 -0400
 
It was thus said that the Great Dirk Laurie once stated:
> 
> Look, the notation "a<b" to mean a non-boolean is so counterintuitive, why
> not use just say "a|b" which can return whatever? Or have you used up all
> the binary operators already?
  I wrote a language in college were you could overload operators and have
them return anything.  Including "<" and ">".  Because of that, I was able
to implement a Unix shell rather easily.  Unix commands were first class
objects and they overrode "<" amd ">" to allow redirection of stdin and
stdout.
  So in that context, it's not at all counterintuitive.  It's just what you
are used to.
  -spc (Never thought of the horror that could happen if you tried to sort
	an array of Unix commands ... )