-
-
Notifications
You must be signed in to change notification settings - Fork 672
Issue 7555 - ddoc whitespace issues due to version tags #3254
New issue
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
Conversation
|
Thanks for the fix. LGTM. |
src/lexer.c
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another comma operator found here. Note that I'm mentioning this since it might eventually become an error in D, and we're heading towards DDMD anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, fixed.
Honestly I have some negative opinion against disallowing comma operators. I doubt the necessity of the disallowing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt the necessity of their initial inclusion to any language. What's the point except to confuse programmers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comma operator confuse programmers? I don't think so.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It may not confuse as-is but it should definitely be reused for something more useful ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comma operator confuse programmers? I don't think so.
Because I have to look up the spec to see how it's implemented. Specifically the order of operations. And then I have to wonder whether the compiler follows the spec.
At the end of the day you could have just used ;, but wanted to hide two statements into one just to save on bracket count.
Also, wasn't there discussion about how tuple implementations require removing the comma operator?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think of the comma operator as the is expression. It's a useful feature, but even advanced users may end up having to look up the documentation to remind themselves of its tricky semantics. Unless of course those experts practically implemented the feature. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Honestly I have some negative opinion against disallowing comma operators. I doubt the necessity of the disallowing.
Spot the bug:
foreach(ch; chain(iota('a', 'я'+1)), iota('А','Я'+1))Sure, foreach could take an AssignExp to prevent this, but there are very few legitimate uses that aren't clearer without the comma.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think of the comma operator as the is expression. It's a useful feature, but even advanced users may end up having to look up the documentation to remind themselves of its tricky semantics. Unless of course those experts practically implemented the feature. :)
The is expression is a lot more complex than the comma operator. The comma operator has the same precedence as the comma in function calls, so the problem is usually forgetting it exists rather than now it works.
The is expression also cannot be trivially rewritten in terms of other constructs. Comma can be: e1, e2 -> { e1; return e2; }().
|
Aaaaanyway LGTM. |
|
Auto-merge toggled on |
Issue 7555 - ddoc whitespace issues due to version tags
https://d.puremagic.com/issues/show_bug.cgi?id=7555