x = y [color=red]=[/color] z ; The second [color=red]=[/color] is ambiguous. Current plan is to treat both as assignments. x = (y [color=red]=[/color] z) ; Current plan is to treat the rightmost one as a comparison. x [color=red]:=[/color] y [color=red]=[/color] z ; Current plan is to treat the rightmost one as a comparison. func(x [color=red]=[/color] 2) ; Current plan is to treat it as a comparison. x [color=red]=[/color] IsDone ? func() : y:=1 ; Current plan is to treat it as an assignment.In conjunction with the plans in the comments above, := would continue in its role as an assignment operator in v2. This is necessary to eliminate ambiguity, but more importantly to allow assignments in places that would otherwise be comparisons such as: if Var := func()
Comments are welcome on any of the above, especially the code examples. Can you think of any other ambiguities? If more are found, it could sway the decision to some other alternative.
The main alternative to all of this is to switch over to a complete C-like syntax where = is always an assignment (never a comparison). In that case, == would be used for comparisons, and a new operator would be needed for case-sensitive comparisons. But due to it being mildly counterintuitive (especially to those without any C-like experience), this cure seems worse than the disease.
It should also be mentioned that users can practice one of the following rules to avoid most ambiguity:
1) Always use := for assignments and = or == for comparisons.
2) Always use = for assignments and == for comparisons (but this wouldn't eliminate all ambiguities, just some).
Comments are welcome. Now is the time to say something if you see a better approach.