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

Brent Royal-Gordon brent at architechies.com
Thu Feb 4 15:40:55 CST 2016

> And it's not something that will ever reasonably apply to anything except #file and #line.

Why not `#function`, at least? `#function` is a human-readable indication of the surrounding unit of code. It's not intended to be used to look things up in the compiled file. If you're generating code from a definition somewhere, shouldn't `#function` properly reference that definition, not whatever random garbage your generator spat out because it was easier to structure the generated code that way?

Certainly `#dsoHandle` and the hypothetical `#mangledName`, which refer to locations in compiled code and can be used to look code up at runtime, shouldn't be settable, but I think all of the things that point to source code locations ought to be fair game.

Brent Royal-Gordon

More information about the swift-evolution mailing list