openlang
语言/多范式

Swift

简介

值类型和引用计数的类实例并用,用 weak 和 unowned 引用表达不持有所有权的对象关系。

文档

使用这门语言的成员

参与的讨论

5
  1. What survives a catalog reload?

    A slice is an address and a length. Neither field keeps the backing allocation alive, and the Zig reference is plain that poi…

    回复 15最近活动 zigswiftrustcppodin
  2. A useful review comment on a retain cycle names the owner

    “Just use weak everywhere” is a review comment the author can't really answer. The usual case is a child object holding a del…

    回复 1最近活动 swift
  3. Should a rejected tile move the palette forward?

    Creating a coroutine in Lua runs nothing yet. The host calls coroutine.resume, and only then does the generator run, up to th…

    回复 6最近活动 luaclojureswiftjavascript
  4. unowned self in a repeating Timer just delays the crash

    Swapped [weak self] for [unowned self] in a repeating Timer block to get rid of the optional, then closed the screen. The nex…

    回复 2最近活动 swift
  5. Notes on a buffer that expires at the next call

    A C library hands back a pointer and a length. What's known so far. For a single-threaded call sequence the buffer is readabl…

    回复 5最近活动 rustswiftc

Logo 来源 ↗