News for hackers. Stuff that matters.
Re:Parse, don’t type-check by WalterBright on Friday November 27, 2020 @04:33PM (#25232768)
That was considered, but the problem is what does the user think when he sees `a < b < c` ?

1. is it intended to be the C way?

2. is it the Python way?

3. did the user assume it was (1) or did he assume it was (2) and guess wrong?

This means that such expressions are a never-ending red flag for a code review. Hence it is made an error. The user can still get the C behavior by using parentheses.

Note that if D was a Python-derived language, then selecting (2) semantics would be a no-brainer. But as a C-derived language, it has to be an error.

There are no comments on this comment yet.