[swift-users] Why is static a keyword?

Zhao Xin owenzx at gmail.com
Thu May 11 12:22:52 CDT 2017


Yes, I had. There was a `class` and `static` post under it. But I disagreed
that and  my interpretation was just opposite.

Zhaoxin

On Fri, May 12, 2017 at 1:11 AM, Adrian Zubarev <
adrian.zubarev at devandartist.com> wrote:

> Have you read closely the bug issue before posting your answer?
>
>
>
> --
> Adrian Zubarev
> Sent with Airmail
>
> Am 11. Mai 2017 um 19:05:13, Zhao Xin (owenzx at gmail.com) schrieb:
>
> No. I think it is just a compromise.
>
> Zhaoxin
>
> On Fri, May 12, 2017 at 1:01 AM, Adrian Zubarev <
> adrian.zubarev at devandartist.com> wrote:
>
>> I don’t think this is the answer that was asked for. I bet it’s more a
>> technical question from the internal point of of view.
>>
>>
>> --
>> Adrian Zubarev
>> Sent with Airmail
>>
>> Am 11. Mai 2017 um 18:59:58, Zhao Xin via swift-users (
>> swift-users at swift.org) schrieb:
>>
>> In Swift, you use `static in struct and enum` and `class in class`. For
>> example,
>>
>> struct Foo {
>>
>>     static func bar() {
>>
>>
>>
>>     }
>>
>> }
>>
>>
>> class ClassFoo {
>>
>>     class func bar() {
>>
>>
>>
>>     }
>>
>> }
>>
>>
>> Another the `class func bar()` can replace to `static` as well. Here the
>> `static` and `class` are equal in functions of classes.
>>
>>
>> And `class` is a keyword.
>>
>>
>> class ClassFoo2 {
>>
>>     static func bar() {
>>
>>
>>
>>     }
>>
>> }
>>
>>
>> Zhaoxin
>>
>>
>>
>> On Fri, May 12, 2017 at 12:17 AM, Jose Cheyo Jimenez via swift-users <
>> swift-users at swift.org> wrote:
>>
>>> I was expecting static to be a builtin. Does anybody know why it must be
>>> a keyword?
>>>
>>> Background. https://bugs.swift.org/browse/SR-4834
>>>
>>> _______________________________________________
>>> swift-users mailing list
>>> swift-users at swift.org
>>> https://lists.swift.org/mailman/listinfo/swift-users
>>>
>>>
>> _______________________________________________
>> swift-users mailing list
>> swift-users at swift.org
>> https://lists.swift.org/mailman/listinfo/swift-users
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20170512/934c7bf6/attachment.html>


More information about the swift-users mailing list