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
440
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
Introducing ReActionView: A new ActionView-Compatible ERB Engine @ Kaigi on Rails 2025, Tokyo, Japan
marcoroth
3
1k
AI Coding Meetup #3 - 導入セッション / ai-coding-meetup-3
izumin5210
0
3.3k
あなたとKaigi on Rails / Kaigi on Rails + You
shimoju
0
160
AI Agent 時代的開發者生存指南
eddie
2
1.7k
Cursorハンズオン実践!
eltociear
2
1.1k
ALL CODE BASE ARE BELONG TO STUDY
uzulla
25
6.2k
XP, Testing and ninja testing ZOZ5
m_seki
3
690
チームの境界をブチ抜いていけ
tokai235
0
180
品質ワークショップをやってみた
nealle
0
460
なぜあの開発者はDevRelに伴走し続けるのか / Why Does That Developer Keep Running Alongside DevRel?
nrslib
3
410
All About Angular's New Signal Forms
manfredsteyer
PRO
0
170
Devoxx BE - Local Development in the AI Era
kdubois
0
130
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
10
870
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
980
Mobile First: as difficult as doing things right
swwweet
224
10k
Build your cross-platform service in a week with App Engine
jlugia
232
18k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Navigating Team Friction
lara
190
15k
Building a Modern Day E-commerce SEO Strategy
aleyda
44
7.8k
Reflections from 52 weeks, 52 projects
jeffersonlam
353
21k
KATA
mclloyd
32
15k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
Producing Creativity
orderedlist
PRO
347
40k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.2k
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
!