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

Dave Abrahams dabrahams at apple.com
Thu Feb 4 02:24:25 CST 2016

on Wed Feb 03 2016, Chris Lattner <swift-evolution at swift.org> wrote:

> Proposal Link:
> https://github.com/apple/swift-evolution/blob/master/proposals/0028-modernizing-debug-identifiers.md
> The review of SE-0028 "Modernizing Swift's Debugging Identifiers" ran
> from January 29… February 2, 2016. The proposal has been *accepted*,
> with modifications:
> * The core team agrees that we should rename all of the existing
> __FILE__, __LINE__, __COLUMN__, __FUNCTION__, and __DSO_HANDLE__
> symbols to lowercase equivalents in the # namespace: #file, #line,
> #column, #function, #dsohandle.  This includes keeping __FUNCTION__,
> and making #line have the dual behavior of being a directive when it
> is the first token on a line, but an expression otherwise.  Renaming
> these symbols improves uniformity within the Swift language, and
> keeping all of them provides a smooth transition path from the old
> syntax to the new syntax.
> * The core team isn’t thrilled with the magic “first token on a line”
> whitespace behavior that #line will be getting, and would like someone
> to start a discussion about renaming the old #line directive to
> something more specific and tailored to its purpose.  Once that name
> and syntax is settled, we can rename the directive and remove the
> whitespace rule.

I'm afraid we'll ultimately need to solve this some other way than by
choosing a different name.  We're eventually going to end up with
something meaning #sourceLocation (modulo capitalization) and that's
obviously (IMO) going to be the right name for both entities.

> * The core team requests that #symbol be split out into a separate
> proposal, because it needs more detailed design work, and is an
> additive feature.  For example, it might be appealing to provide a
> "#mangledName” expression that provides the current symbol as a
> mangled name: when fed into a demangler, a more structured form of the
> current symbol would be available.
> Thank you to Erica Sadun for driving this forward!
> -Chris Lattner
> Review Manager
> _______________________________________________
> swift-evolution mailing list
> swift-evolution at swift.org
> https://lists.swift.org/mailman/listinfo/swift-evolution


More information about the swift-evolution mailing list