-
Notifications
You must be signed in to change notification settings - Fork 38
Pun record declaration fields when possible. #64
Conversation
Requested in #47
@IwanKaramazow was there something to be careful about for unary records? |
That was in record expressions. Not yet sure how we could tackle that one |
Let's hold off on this one. Not sure about printing record punning yet |
@chenglou What exactly are you unsure about / what are your concerns? |
cknitt it's possible that we reconsider punning in favor of some other syntax possibilities |
If we allow punning in writing, we should do punning in printing, This would create confusion for example, people write code:
and formatted as
People will read it that you are against such style, if you are against such style, why not prohibit in the beginning (in the parsing)?. I am not against/for punning, but we should be consistent here |
@chenglou I agree with @bobzhang that we should be consistent here. Also, I think it would be a mistake to remove punning support because:
In short, not supporting punning would feel like a regression to me, both compared to the old Reason parser and to JS. So I am quite curious about what the "other syntax possibilities" are that outweigh these concerns. |
@cknitt I digged into a little bit. The proposal is to remove punning in type declarations not in expressions where punning is mostly used. Does it sound good to you? |
@bobzhang Thanks for digging! That's good news. I had understood Cheng's comments to mean that he would like to remove punning altogether.
|
I don't mind losing punning on types fields (data fields a different story) but agree with Bob that I would dislike the inconsistency of considering it valid syntax but rewriting it on fmt. |
One year later I still would love to have this one back. Code just gets more verbose than in Reason. |
@IwanKaramazow I guess the conclusion of this discussion is that we want to keep the record field declarations always explicit. For punning record values, we already merged #480. So I'd propose to close this for now. |
Requested in #47