You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
X=1,2;X will assign X=1 and then create a stream (),2, so the output of this is 1. X=(1,2) work as expected.
This should either assign both 1 and 2 to X, or forbid the construction altogether. X = 1,2, X = 1 , 2, and X = 1, 2 should do the same thing as X=1,2.
A few possible solutions:
The program could output (1,2)
It could be an error to assign inside a comma at the same precedence level (X=1,2 or X = 1, 2).
It could be an error to leave a value unused anywhere.
The program could return the stream 2,1 because there are 2 statements that return values. In this case, () cannot be a value. This might be a wonderful idea, but we still need something more targeted to tell the user that X=1,2 isn't doing what it looks like it should.
The text was updated successfully, but these errors were encountered:
jkeiser
changed the title
X=1,2;X does not error even thought 2 is unusedX=1,2;X does not error even though 2 is unused
May 12, 2022
X=1,2;X
will assign X=1 and then create a stream(),2
, so the output of this is1
.X=(1,2)
work as expected.This should either assign both 1 and 2 to X, or forbid the construction altogether.
X = 1,2
,X = 1 , 2
, andX = 1, 2
should do the same thing asX=1,2
.A few possible solutions:
()
cannot be a value. This might be a wonderful idea, but we still need something more targeted to tell the user that X=1,2 isn't doing what it looks like it should.The text was updated successfully, but these errors were encountered: