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
54
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
Swift Attributes
hokuron
0
270
Peek in Calendar implementation of swift-foundation
hokuron
0
100
MVVM
hokuron
0
30
Summon Rust from Swift
hokuron
0
530
Opaque Result Type in Swift with Rust
hokuron
0
120
Ownership of Swift as seen from iteration and Rust
hokuron
1
570
Clean Architecture 3
hokuron
0
24
Clean Architecture 2
hokuron
0
45
Create MLで犬と猫の肉球を学習
hokuron
0
72
Other Decks in Programming
See All in Programming
Terraformテスト入門
msato
0
540
CSC307 Lecture 11
javiergs
PRO
0
240
Play Billing Library 7.0.0 変更点まとめ@potatotips#88
kako351
0
160
Microservices rules (July 2024) : what good looks like
cer
PRO
0
1.6k
今こそ始める、CDKコンストラクトライブラリ開発 ― 入門から実践まで
tmokmss
1
930
Trial
cairolibrary720
1
130
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
Async Await: Mastering Python's Time-Bending Tricks - EuroPython2024
yanbo
1
290
CSC307 Lecture 07
javiergs
PRO
0
220
Clean Architecture by TypeScript & NestJS
ryounasso
0
150
AHC035解説
terryu16
0
720
継続的な活動で築く地方エンジニアの道
myamashii
2
360
Featured
See All Featured
Music & Morning Musume
bryan
43
5.9k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
245
1.2M
We Have a Design System, Now What?
morganepeng
46
7k
Atom: Resistance is Futile
akmur
261
25k
Art, The Web, and Tiny UX
lynnandtonic
291
20k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
121
18k
Done Done
chrislema
179
15k
Building Flexible Design Systems
yeseniaperezcruz
323
37k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Practical Orchestrator
shlominoach
185
10k
Large-scale JavaScript Application Architecture
addyosmani
506
110k
Code Reviewing Like a Champion
maltzj
517
39k
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
!