[swift-evolution] [Discussion]: Renaming #line, the line control statement

Chris Lattner clattner at apple.com
Thu Feb 11 15:13:35 CST 2016


On Feb 8, 2016, at 10:45 AM, Dave Abrahams via swift-evolution <swift-evolution at swift.org> wrote:
>> A more flexible grammar was suggested, however, as Kevin Ballard
>> pointed out, "This feature isn't something end users are going to
>> use. And it's not something that will ever reasonably apply to
>> anything except #file and #line. This feature is only ever intended to
>> be used by tools that auto-generate source files. The most important
>> concerns here really should just be that whatever we use is trivial to
>> generate correctly by even the simplest of tools and is readable. And
>> since this won't ever apply to anything beyond #file and #line,
>> there's no need to try to generalize this feature at all."
> 
> +1 for the idea, but...
> 
> I don't think we should make this change without also making the feature
> useful for things like gyb, which has to use its own home-brew line
> directive machinery because #line is AFAIK currently useless for any
> known application.  The way it currently works you can only put the
> directive at grammatical boundaries in the program where #if would also
> work.  For #if this is a feature, but for #resetfilecontext it's a bug.
> 
> Isn't it the case that making this feature useful would require a lot
> more than the simple syntactic shuffle being proposed here?

I completely disagree with this approach.  Making the existing feature “more useful” is orthogonal from repainting it.  Getting the paint right is a high priority for Swift 3, but making it “more useful” is low priority.

-Chris



More information about the swift-evolution mailing list