Discussion:
in() assignment
(too old to reply)
Ron Chan
2004-07-01 19:12:14 UTC
Permalink
According to the specs, the proper syntax for the input statement is:

Identifier <- in();

Can this be considered an assignment statement?
i.e. can the input be assigned to an array element: a[4] <- in();
i.e. can it be used as one of the for loop's optional parameters?

for (x <- in(); !y; z <- z + 1)

If so, wouldn't "in()" be better off recognized as an expression so we may
generalize it with the assignment statement?
Nguyen Nguyen
2004-07-01 21:36:32 UTC
Permalink
No, an "in" statement is not an assignment statement. It just happens
that both statements contain the ASSIGN token.

Nguyen
Post by Ron Chan
Identifier <- in();
Can this be considered an assignment statement?
i.e. can the input be assigned to an array element: a[4] <- in();
i.e. can it be used as one of the for loop's optional parameters?
for (x <- in(); !y; z <- z + 1)
If so, wouldn't "in()" be better off recognized as an expression so we may
generalize it with the assignment statement?
Loading...