# My personal beef with leading-dot syntax

**URL:** <https://forums.swift.org/t/my-personal-beef-with-leading-dot-syntax/2055>\
**Category:** Discussion\
**Created:** [April 4, 2016, 6:05pm UTC](https://forums.swift.org/t/my-personal-beef-with-leading-dot-syntax/2055 "2016-04-04T18:05:00Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Radek\_Pietruszewski](https://avatars.discourse-cdn.com/v4/letter/r/74df32/32.png) [@Radek\_Pietruszewski](https://forums.swift.org/u/Radek_Pietruszewski)\
**Post date:** [April 5, 2016, 7:55am UTC](https://forums.swift.org/t/my-personal-beef-with-leading-dot-syntax/2055/5 "2016-04-05T07:55:46Z")

</div>

As others noted:

\* the ability to say .min, .max, .blackColor(), etc is extremely useful. Swift would be a lot worse off if only enum cases got their enum types inferred, and for any other static member of a type I would have type the fully qualified name  
\* the leading dot disambiguates the reference for the compiler \*\*and for the reader\*\*. I don’t have to guess if I’m not referencing something local, or explicitly disambiguate when needed. I just say, “.foo”, and it’s clear.  
\* I disagree that the rules of lookup are confusing. The feature is poorly documented in official guides, but it seems pretty straightforward to me. For any context implying T, .foo means a static member T.foo. Like you said, could be subjective ¯\_(ツ)\_/¯

Best,  
— Radek

> **···**
>
> > On 04 Apr 2016, at 20:05, Dave Abrahams via swift-evolution \<swift-evolution@swift.org\> wrote:
> > 
> > on Mon Apr 04 2016, Erica Sadun \<swift-evolution@swift.org\> asked:
> > 
> > > Can you ping me off-list or in another thread and explain what the  
> > > issues are?
> > 
> > All of the following make me uncomfortable with our leading-dot thang:
> > 
> > \* The rules for lookup don't seem obvious to me. I admit this is very  
> > personal/subjective.
> > 
> > \* There is some evidence that people think it means something it doesn't  
> > (“enum case”), as mentioned in SE-0036. That suggests it is a  
> > confusing feature. That confusion may be fairly harmless so far, but  
> > still.
> > 
> > \* The dot doesn't seem to buy enough to be worth the complexity it adds  
> > to the language; why not just let those names be looked up without the  
> > dot? You can always disambiguate with full qualification if you have  
> > to.
> > 
> > \* Static members generally are too verbose to access from within members  
> > of a type (`Self.x` doesn't work; you have to write out  
> > `TheFullTypeName.x`), and leading-dot doesn't give the ability to do  
> > so. If we're going to have a special syntax for accessing static  
> > members, it should \*at least\* solve this problem.
> > 
> > --  
> > Dave
> > 
> > \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_  
> > swift-evolution mailing list  
> > swift-evolution@swift.org  
> > [https://lists.swift.org/mailman/listinfo/swift-evolution](https://lists.swift.org/mailman/listinfo/swift-evolution)

---

_[View the full topic](https://forums.swift.org/t/my-personal-beef-with-leading-dot-syntax/2055)._
