> On Apr 6, 2016, at 9:27 AM, Jordan Rose via swift-evolution
> wrote:
>
>
>> On Apr 5, 2016, at 0:55 , Radosław Pietruszewski via swift-evolution
>> wrote:
>>
>> As others noted:
>>
>> * the ability to say .min, .max, .blackColor(),
> Agreed. Let me ask the question differently: what value does the
> leading `.` provide to the user of the language?
I find the leading-dot syntax to be very useful; it's a pretty clear shorthand
that I'm not referencing something at global scope.
Here's a common example from our codebase:
> On Apr 5, 2016, at 0:55 , Radosław Pietruszewski via swift-evolution
> wrote:
>
> 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,
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
*like* types. I, at no point, said that they are types.
Pointing out what they can't do is not a great stance, in my opinion,
because some of those things are perfectly reasonable but simply might not
have been considered or attempted yet. I am *not* arguing that they are
types. I am arguing that
> Because semantically they seem more like types unto themselves
But they aren't types.
* You can't declare a variable/property/parameter of a particular case.
* You can't constrain a generic type parameter to a case.
* You can't cast to a case with `as` and friends or test for a case with `is`.
Because semantically they seem more like types unto themselves–which is why
I disagree with the lower camel casing but I digress–and the fact that they
are static members seems like an implementation detail more than anything
else.
TJ
On Mon, Apr 4, 2016 at 10:15 PM, Joe Groff
> On Apr 4, 2016, at 6:27 PM, T.J. Usiyan via swift-evolution
> wrote:
>
> Is a solution to this actually making the leading dot mean enum lookup, full
> stop and allowing `Self.foo`? The case that that doesn't cover is static
> members on a type other than `Self`.
Is a solution to this actually making the leading dot mean enum lookup,
full stop and allowing `Self.foo`? The case that that doesn't cover is
static members on a type other than `Self`. I use it to great effect for
standard instances of types, so I would appreciate *some* facility to
provide
I believe the confusion comes from language references only using the leading
dot to access enumerated values, and not to access an option set implementation
or something like UIColor.
I can’t speak to the compiler processing impact or language impact of potential
conflicts of looking these up
> When I have a context that demands an instance of a
> particular enum type, I think it's reasonable to look up the names in
> the enum without qualification, and I strongly question the value of
> leading-dot syntax for general static member lookup. I would normally
> never think of using it
Moving away from the compiler, I like the leading dot for the programmer to
distinguish static and instance members. The 'missing' receiver natural
means static to me.
On Tuesday, 5 April 2016, Dave Abrahams via swift-evolution <
swift-evolution@swift.org> wrote:
>
> on Mon Apr 04 2016, Joe
on Mon Apr 04 2016, Joe Groff wrote:
>> On Apr 4, 2016, at 12:51 PM, Dave Abrahams wrote:
>>
>>
>> on Mon Apr 04 2016, Joe Groff wrote:
>>
>
On Apr 4, 2016, at 11:44 AM, Dave Abrahams wrote:
on Mon
on Mon Apr 04 2016, Joe Groff wrote:
>> On Apr 4, 2016, at 11:44 AM, Dave Abrahams wrote:
>>
>>
>> on Mon Apr 04 2016, Joe Groff wrote:
>>
>
On Apr 4, 2016, at 11:05 AM, Dave Abrahams via swift-evolution
wrote:
on
> On Apr 4, 2016, at 12:51 PM, Dave Abrahams wrote:
>
>
> on Mon Apr 04 2016, Joe Groff wrote:
>
>>> On Apr 4, 2016, at 11:44 AM, Dave Abrahams wrote:
>>>
>>>
>>> on Mon Apr 04 2016, Joe Groff wrote:
>>>
>>
> On Apr 4, 2016, at 11:05 AM,
> On Apr 4, 2016, at 11:44 AM, Dave Abrahams wrote:
>
>
> on Mon Apr 04 2016, Joe Groff wrote:
>
>>> On Apr 4, 2016, at 11:05 AM, Dave Abrahams via swift-evolution
>>> wrote:
>>>
>>>
>>> on Mon Apr 04 2016, Erica Sadun
on Mon Apr 04 2016, Joe Groff wrote:
>> On Apr 4, 2016, at 11:05 AM, Dave Abrahams via swift-evolution
>> wrote:
>>
>>
>> on Mon Apr 04 2016, Erica Sadun asked:
>>
>
>>> Can you ping me off-list or in another thread and explain what
> On Apr 4, 2016, at 11:05 AM, Dave Abrahams via swift-evolution
> wrote:
>
>
> on Mon Apr 04 2016, Erica Sadun asked:
>
>> Can you ping me off-list or in another thread and explain what the
>> issues are?
>
> All of the following make
> On Apr 4, 2016, at 12:05 PM, Dave Abrahams via swift-evolution
> wrote:
>
>
> on Mon Apr 04 2016, Erica Sadun asked:
>
>> Can you ping me off-list or in another thread and explain what the
>> issues are?
>
> All of the following make
on Mon Apr 04 2016, Erica Sadun 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
20 matches
Mail list logo