Open bbrk24 opened 2 years ago
~
should be doable.
I forgot that it's already being used for pattern matching. I don't know how much of a problem that would be.
G'DAY MATE!
I RECKON inf = 1 / 0;
GIMME inf == inf;
CHEERS C***!
Gives Yeah, nah!
. x != x
is the typical test for NaN; generally Infinity == Infinity
.
Should we consider bitwise operators? I imagine
<<
and>>
will run into parsing issues, but|
,&
,^
, and~
should be doable. Alternatively, we could use words for all six. (I have no suggestions for what.)Why does
!0 == !1
? They both evaluate toYEAH, NAH!
which doesn't make sense to me. Typically,0
corresponds to one boolean and all other integers to the other. This isn't always completely accurate -- for example, Objective-C does this mod 256 -- but I'd say it's pretty uncontroversial that0
and1
should have different boolean values.Should we have literals for NaN and Infinity? It is possible to get them (
0 / 0
and1 / 0
respectively) but I'd prefer them to have names. They currently print asNaN
andinf
respectively, so if we give them names then the string conversion has to be updated to match.The syntax highlighting shows literals like
1e9
as if they're numbers, but they don't work:OI MATE! EXPECTED ; BUT GOT 'e9'
. It would be nice to be able to express large or small numbers using scientific notation, or have an exponentation operation (likepow()
or**
) -- preferably both.