[swift-evolution] [Review] SE-0037 Clarify interaction between comments & operators

Jesse Rusak me at jesserusak.com
Sat Mar 12 13:33:47 CST 2016


Hey Patrick,

Thanks for the feedback. A couple comments below:

> On Mar 12, 2016, at 2:16 PM, Patrick Gili via swift-evolution <swift-evolution at swift.org> wrote:
> 
>> 
>> 	• What is your evaluation of the proposal?
> 
> I think the alternative to simply ignore comments would be a better direction, especially since the proposal breaks code.

Unfortunately, the alternative proposal (ignoring comments) could also break code because comments are currently treated as non-whitespace in most cases. For example, this currently works:

1 /* */+2

(Because the “+” has no whitespace on either side.) If comments were completely ignored, this would be an error since there is whitespace to the left of the “+” but not the right.

If you’re interested in a more complete discussion of this direction, you can see an earlier draft which proposed this in the history <https://github.com/apple/swift-evolution/blob/c719adf87dae3382319e387fcf3145322a9f1239/proposals/0037-clarify-comments-and-operators.md>.

>> 	• Is the problem being addressed significant enough to warrant a change to Swift?
> 
> No.

This is admittedly a small issue, so I can understand this point of view. The current state, though, seems pretty surprising to me — comments are treated as non-whitespace in most cases, ignored in others, and the contents of comments can affect the interpretation of the surrounding code. These are pretty clearly bugs which, to me at least, seem worth fixing.

>> 	• Does this proposal fit well with the feel and direction of Swift?
> 
> No.
> 
>> 	• If you have used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?
> 
> Other languages ignore comments, and hence I think the alternative discussed in the proposal represents a better direction.
> 
>> 	• How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> 
> Quick read.
> 
>> 
> 
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20160312/f462be51/attachment.html>


More information about the swift-evolution mailing list