[swift-evolution] [swift-evolution-announce] [Review] SE-0028 Modernizing Swift's Debugging Identifiers (__LINE__, etc)

Adrian Prantl aprantl at apple.com
Fri Jan 29 17:35:33 CST 2016


I am mostly concerned by the ambiguity of the new #line _identifier_ with the existing #line _directive_. As the proposal mentions, the two can be syntactically disambiguated by constraining the #line directive to column 1. Aesthetically, using the same #ident syntax for identifiers that grammatically behave like literals and for compiler directives that trigger an action during compilation seems a little inconsistent to me.

Like the __LINE__ identifier the #line directive inherited its syntax from the C preprocessor. In the case of the #line directive, there is value in using this inherited syntax because it is compatible with many preprocessing tools and code generators that output this format. If we change the syntax of the #line directive, we’re no longer compatible with these tools.


> 	* What is your evaluation of the proposal?
I support the variant of the proposal that renames the __LINE__ identifier to #linenumber.
> 	* Is the problem being addressed significant enough to warrant a change to Swift?
N/A
> 	* Does this proposal fit well with the feel and direction of Swift?
Yes
> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
A quick reading.

-- adrian


More information about the swift-evolution mailing list