[swift-evolution] [Proposal] Eliminating Swift's Screaming Snake Case Identifiers
jgroff at apple.com
Tue Jan 26 17:23:58 CST 2016
> On Jan 26, 2016, at 1:48 PM, Erica Sadun via swift-evolution <swift-evolution at swift.org> wrote:
> What do you think of:
> #file, #lineNumber, #column, #symbol (e.g. Swift.Dictionary.init), #module, #contextDictionary
I'd prefer to use #line for this, and constrain the use of the current #line directive by context; like Chris said, we could require it to be the first thing after a newline, or we could adopt the `#line = ...` syntax a few people suggested.
> and calling it a day?
> * using contextDictionary allows expandability and can subsume all existing context elements, indexed presumably by the same names
> * renaming function to symbol takes care of self.dynamicType as well
> * file and lineNumbers are gimmes
> * column is apparently well liked by some (not going to kick someone's dog on this)
> * adding module fills a big hole.
> No tuples for Doug, covers some of Chris's points.
> -- E
>> On Jan 24, 2016, at 4:12 PM, Remy Demarest <remy.demarest at gmail.com <mailto:remy.demarest at gmail.com>> wrote:
>> +1 I love the idea of having not-only consistent naming convention for compiler-magic code starting with #.
>> And I also love the idea that source location would be one object that you can print to get the full story while still retaining the possibility to use each individual components as needed, which is probably the rarer case. I never find myself wanting only some of properties and usually don't include them simply because it takes longer to write the format properly, if I can get them all in one go it's certainly a win.
>> Remy Demarest
>> remy.demarest at gmail.com <mailto:remy.demarest at gmail.com>
>>> Le 23 janv. 2016 à 18:46, Erica Sadun via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> a écrit :
>>> Pull request: https://github.com/apple/swift-evolution/pull/116 <https://github.com/apple/swift-evolution/pull/116>
>>> -- E
>>>> On Jan 22, 2016, at 5:40 PM, Chris Lattner <clattner at apple.com <mailto:clattner at apple.com>> wrote:
>>>>> On Jan 22, 2016, at 1:43 PM, Jack Lawrence <jackl at apple.com <mailto:jackl at apple.com>> wrote:
>>>>> Indeed. Here’s the grammar from TSPL:
>>>>> line-control-statement → #line
>>>>> <>line-control-statement → #lineline-number <https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/line-number>file-name <https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/Statements.html#//apple_ref/swift/grammar/file-name>
>>>>> <>line-number → A decimal integer greater than zero
>>>>> <>file-name → static-string-literal <https://developer.apple.com/library/ios/documentation/Swift/Conceptual/Swift_Programming_Language/LexicalStructure.html#//apple_ref/swift/grammar/static-string-literal>
>>>> Huh ok, I forgot we supported that. We could handle that by requiring that form of #line to be at the start of a line, if necessary.
>>> swift-evolution mailing list
>>> swift-evolution at swift.org <mailto:swift-evolution at swift.org>
>>> https://lists.swift.org/mailman/listinfo/swift-evolution <https://lists.swift.org/mailman/listinfo/swift-evolution>
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution