Uh oh!
There was an error while loading. Please reload this page.
RFC: require parentheses for chained comparisons - #558
Conversation
sinistersnare
commented
Jan 7, 2015
I like this, I wonder how other people will react :) |
SimonSapin
commented
Jan 7, 2015
+1. I don’t worry too much about the current behavior being unexpected, but I’d like the option to add Python-style chained comparisons in the future. |
Kimundi
commented
Jan 7, 2015
I'm in favour of this, simply because it increases the number of options we can take post 1.0, and is unlikely to have much fallout. Personally, I'd use parenthesis anyway in any case where I'd wanted to code like the one affected by this change, so I don't see it as a loss. |
dgrunwald
commented
Jan 7, 2015
While testing my implementation for this, I found an unexpected interaction with another part of the language: generic syntax. It turns out when compiling fnf<T>(){}fnmain(){
f<i32>();}the error message changes from "error: unresolved name |
Mention that this doesn't break rustc.
dgrunwald
commented
Jan 7, 2015
I have implemented this RFC: https://github.com/dgrunwald/rust/compare/require-parens-for-chained-comparison |
huonw
commented
Jan 7, 2015
This looks like a good idea, for all the reasons given: correctness, Python style chaining and better |
huonw
commented
Jan 7, 2015
This is likely to be merged before alpha, I'm just waiting on feedback from @nikomatsakis. Thanks for writing the patch already, @dgrunwald! (I see from your github profile that you're in Europe, meaning it's nighttime; so I'll likely make the PR with your commit and manage getting it merged, unless you are in fact awake. 😄 ) |
nikomatsakis
commented
Jan 8, 2015
@huonw r+ |
nrc
commented
Jan 8, 2015
I approve of the idea and I realise it is just before the alpha, but merging a new RFC in 16 hours and with 3 comments is not really in the spirit of the RFC process. |
huonw
commented
Jan 8, 2015
Oh I forgot to write a comment with the thinking. Thank you for the prompt, @nick29581. All the (admittedly few) comments are positive, and I got feedback from most of core team. Everyone was in favour of merging this for the alpha as a conservative step that also had concrete immediate improvements (the error messages for C++-style type hints are much better). The intention is to revisit and possibly revert in future. I opened #561. |
Rendered