We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Either of these two lines will trigger an infinite loop, where you would expect them to do nothing:
0 && 1 1 || 0
This behavior seems to magically resolve when the expression is assigned to a variable, e.g.
_ = 0 && 1
The text was updated successfully, but these errors were encountered:
I cannot reproduce:
> 0 && 1 false > 1 || 0 true > def f() 0 && 1 end syntax_error: stdin:1: strict: expression without side effect detected > def f() return 0 && 1 end > f() false
Sorry, something went wrong.
These lines need to be parsed together. Try 0 && 1 1 || 0 in REPL.
Ah yes indeed. What's interesting is when running in strict mode, it gets the following error (which is expected):
> 0 && 1 1 || 0 syntax_error: stdin:1: strict: expression without side effect detected
Now looking at the produced code:
> def f() 0 && 1 1 || 0 end > import debug > debug.codedump(f) source 'stdin', function 'f': ; line 1 0000 LDCONST R0 K0 0001 JMPF R0 #0001 0002 LDCONST R0 K1 0003 JMPT R0 #0003 0004 RET 0
There is definitely a problem at line 3.
No branches or pull requests
Either of these two lines will trigger an infinite loop, where you would expect them to do nothing:
This behavior seems to magically resolve when the expression is assigned to a variable, e.g.
The text was updated successfully, but these errors were encountered: