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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Takuma Shimizu
March 27, 2019
Programming
0
83
Generalized accessors
Takuma Shimizu
March 27, 2019
Tweet
Share
More Decks by Takuma Shimizu
See All by Takuma Shimizu
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
72
Swift Attributes
hokuron
0
450
Peek in Calendar implementation of swift-foundation
hokuron
0
220
MVVM
hokuron
0
55
Summon Rust from Swift
hokuron
0
700
Opaque Result Type in Swift with Rust
hokuron
0
170
Ownership of Swift as seen from iteration and Rust
hokuron
1
710
Clean Architecture 3
hokuron
0
62
Clean Architecture 2
hokuron
0
79
Other Decks in Programming
See All in Programming
CopilotKit + AG-UIを学ぶ
nearme_tech
PRO
1
140
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
360
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
450
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
240
Claude Code、ちょっとした工夫で開発体験が変わる
tigertora7571
0
200
TROCCOで実現するkintone+BigQueryによるオペレーション改善
ssxota
0
140
Agent Skills Workshop - AIへの頼み方を仕組み化する
gotalab555
15
8.1k
AI駆動開発の本音 〜Claude Code並列開発で見えたエンジニアの新しい役割〜
hisuzuya
4
480
AI主導でFastAPIのWebサービスを作るときに 人間が構造化すべき境界線
okajun35
0
600
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
400
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
200
ふつうの Rubyist、ちいさなデバイス、大きな一年
bash0c7
0
680
Featured
See All Featured
ラッコキーワード サービス紹介資料
rakko
1
2.5M
Google's AI Overviews - The New Search
badams
0
930
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.2k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
330
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
2.4k
A better future with KSS
kneath
240
18k
Git: the NoSQL Database
bkeepers
PRO
432
66k
Test your architecture with Archunit
thirion
1
2.2k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
87
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
130
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
!