links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
332 stars 42 forks source link

Comparison with infinity/forever #1126

Closed vcgalpin closed 2 years ago

vcgalpin commented 2 years ago

Some comparisons with infinity give errors:

links> var t1 = parseDate("2022-08-04 12:03:12");
t1 = 2022-08-04 12:03:12.000000+1 : DateTime

links> var t2 = forever;
t2 = infinity : DateTime

links> t2 == t1;
***: Runtime error: Comparing infinity with 2022-08-04 12:03:12.000000+1 which either does not make sense or isn't implemented. 

links> t2 <> t1;
***: Runtime error: Comparing infinity with 2022-08-04 12:03:12.000000+1 which either does not make sense or isn't implemented.

links> t2 <= t1;
***: Runtime error: Comparing infinity with 2022-08-04 12:03:12.000000+1 which either does not make sense or isn't implemented. 

Other comparisons are OK:

links> t2 >= t1;
true : Bool

links> t1 < t2;
true : Bool

links> t2 < t1;
false : Bool