[swift-evolution] [Proposal] Eliminating Swift's Screaming Snake Case Identifiers
Brian Gesiak
modocache at gmail.com
Tue Jan 26 21:41:08 CST 2016
I have no strong feelings on the proposal, but I would like to confirm that the behavior will remain the same--this simply changes the name of these identifiers, is that correct?
I ask because swift-corelibs-xctest and the Objective-C XCTest SDK overlay use `__FILE__` and `__LINE__` as default parameters for assertion functions (see: https://github.com/apple/swift-corelibs-xctest/blob/73ff15ac353e6596bf314d66f90e1471043cf071/Sources/XCTest/XCTAssert.swift#L158). These currently evaluate to the callsite of the function: calling `XCTAssert(true)` in a file named "Foo.swift" expands to `XCTAssertTrue(true, file: "Foo.swift")`.
As we attempt to replicate the Objective-C XCTest API in swift-corelibs-xctest, we're beginning to rely on these identifiers more (see: https://github.com/apple/swift-corelibs-xctest/pull/43). It would be quite the setback if the behavior of the identifiers changed on us, so I just wanted to confirm that this proposal is only discussing naming, not behavior.
- Brian Gesiak
On Tue, Jan 26, 2016 at 7:13 PM -0800, "Dave via swift-evolution" <swift-evolution at swift.org> wrote:
-1 I don’t mind how it reads, but Dictionaries return optionals.
> On Jan 26, 2016, at 15:44, Trent Nadeau via swift-evolution wrote:
>
> Instead of #contextDictionary, what about #source. If it's a dictionary, I think that would read better:
>
> #source['file']
> #source['line']
_______________________________________________
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/20160127/93b3b0da/attachment.html>
More information about the swift-evolution
mailing list