Meetesh-Saini / biro

biro language
GNU Affero General Public License v3.0
3 stars 0 forks source link

Simplify comparision operators. #2

Open hellokartikey opened 9 months ago

hellokartikey commented 9 months ago

Why complicate things????

Motivation

Biro has three whole comparison operators. THREE!!! I dont like this kind of bloat from a language that claims to be "Don't complicate things." Frankly this just disgusts me. Biro-Lang... more like Bro-This-Is-Trash-Lang

Solution

Just have one comparison operator <=>, which in of it self is sufficient for all comparison needs. Daddy Turing would be very proud.

Examples

  1. a = 5 and b = 5, a <=> b would return 0.
  2. a = 6 and b=5.999999999, a <=> b would return 1.
  3. a = 723.68349 and b = 723.6835, a <=> b would return -1
Meetesh-Saini commented 9 months ago

This will complicate the things because biro doesn't have NOT operator. So if we want to check if a is less than b then we will have to write: is (1 <=> ((a <=> b) <=> -1) and ((a <=> b) <=> -1) <=> -1) ?

The current syntax is simplier: is a less b ?