Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Generalized accessors
Search
Takuma Shimizu
March 27, 2019
Programming
0
81
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
430
Peek in Calendar implementation of swift-foundation
hokuron
0
190
MVVM
hokuron
0
51
Summon Rust from Swift
hokuron
0
680
Opaque Result Type in Swift with Rust
hokuron
0
160
Ownership of Swift as seen from iteration and Rust
hokuron
1
690
Clean Architecture 3
hokuron
0
54
Clean Architecture 2
hokuron
0
69
Create MLで犬と猫の肉球を学習
hokuron
0
100
Other Decks in Programming
See All in Programming
Catch Up: Go Style Guide Update
andpad
0
220
スマホから Youtube Shortsを見られないようにする
lemolatoon
27
31k
Swift Concurrency - 状態監視の罠
objectiveaudio
2
520
Go言語の特性を活かした公式MCP SDKの設計
hond0413
1
230
高度なUI/UXこそHotwireで作ろう Kaigi on Rails 2025
naofumi
4
4k
kiroとCodexで最高のSpec駆動開発を!!数時間で web3ネイティブなミニゲームを作ってみたよ!
mashharuki
0
170
CSC305 Lecture 06
javiergs
PRO
0
220
Django Ninja による API 開発効率化とリプレースの実践
kashewnuts
0
1.3k
CSC305 Lecture 04
javiergs
PRO
0
270
なぜGoのジェネリクスはこの形なのか? Featherweight Goが明かす設計の核心
ryotaros
7
1.1k
Go言語はstack overflowの夢を見るか?
logica0419
0
260
CSC305 Lecture 05
javiergs
PRO
0
210
Featured
See All Featured
A better future with KSS
kneath
239
18k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
How to Ace a Technical Interview
jacobian
280
24k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
We Have a Design System, Now What?
morganepeng
53
7.8k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Raft: Consensus for Rubyists
vanstee
139
7.1k
[RailsConf 2023] Rails as a piece of cake
palkan
57
5.9k
Balancing Empowerment & Direction
lara
4
690
For a Future-Friendly Web
brad_frost
180
9.9k
Git: the NoSQL Database
bkeepers
PRO
431
66k
Transcript
subscrit get set
get let nums = Array(0..<10) let x10 = nums[3] *
10 // `get` print(num) subscript(index: Int) -> Element { get { let element = // `index` return element // } set { ... } }
set var nums = Array(0..<10) let num = nums[3] nums[3]
= num * 10 // `set` print(num) subscript(index: Int) -> Element { get { ... } set(newValue) { // `newValue` // buffer = newValue } }
Swift 4.2 mutableAddressWithPinnedNativeOwner Swift 5 read , modify yield co-routine
read // CoreAudio.swift subscript(index: Index) -> Element { _read {
yield ((_audioBuffersPointer + index).pointee) } } modify // Array.swift subscript(index: Int) -> Element { _modify { let address = _buffer.subscriptBaseAddress + index yield &address.pointee } }
yield subscript(index: Int) -> inout Element {} inout Rust Lifetime
Rust Swift
yield
!