Implement comparison operators ==, !=, <, >, <=, >=
boeckmann opened this issue · comments
Operators return 1 if true and 0 if false. Operators return undef if one of the operands is undefined. Returned type is byte.
Implemented by f56f7cc.
Hmm.
I had very similar code, but that was in a function called eval(), which then called upon
expr() and friends. So, only if going through eval() we get the comparisons, such as
when you do
.if <comparison expression>
and such.
I think your method is beter, since we keep a single expr() ..
One thing I do not like about my solution is that < and > now have a different meaning depending on context. a) byte select and b) as comparison operator. But I don´t like things like LT, GT, NE, EQ etc. neither. So I probably leave it as it is now.
I want to leave it as byte select because it is VERY common in the Commodore world.
One thing I do not like about my solution is that < and > now have a different meaning depending on context.
Byte select, compare, shift ... (<< and >>)
But I don´t like things like LT, GT, NE, EQ etc. neither.
Yeah, i did add .lt and friends, but true, it's getting quite complicated:
cat win32\*.h win32\*.c *.h *.c targets\mos*
4877
Ouch! There goes your 1,000 lines .. :)
I want to leave it as byte select because it is VERY common in the Commodore world.
Yes. It is used by other processors as well, so we'll leave it in.