fubark / cyber

Fast and concurrent scripting.
https://cyberscript.dev
MIT License
1.18k stars 40 forks source link

OR operator not implemented? #34

Closed sts10 closed 1 year ago

sts10 commented 1 year ago

Is an "OR" operator ready to use? I tried | and it seems to work some of the time, but not always:

a = 22
if a < 10 | a > 20:
    print "a is NOT between 10 and 20"
else: 
    print "I don't know what a is"

I'd expect the above code to print "a is NOT between 10 and 20", but playground prints "I don't know what a is".

I'll note that the following works as expected:

a = 22
if a < 10:
    print "a is less than 10"
if a > 20:
    print "a is greater than 20"
else: 
    print "I don't know what a is"

And thus I suspect this is an issue with the OR logic. Apologies if it's just not implemented yet -- it's not mentioned in the Docs at the moment.

sts10 commented 1 year ago

Whoops, or operator seems to be just or. My bad.