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
89
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Generalized accessors
Takuma Shimizu
March 27, 2019
More Decks by Takuma Shimizu
See All by Takuma Shimizu
RailsのValidatesをSwift Macrosで再現してみた
hokuron
0
180
Swift Attributes
hokuron
0
470
Peek in Calendar implementation of swift-foundation
hokuron
0
250
MVVM
hokuron
0
77
Summon Rust from Swift
hokuron
0
710
Opaque Result Type in Swift with Rust
hokuron
0
180
Ownership of Swift as seen from iteration and Rust
hokuron
1
730
Clean Architecture 3
hokuron
0
71
Clean Architecture 2
hokuron
0
88
Other Decks in Programming
See All in Programming
net-httpのHTTP/2対応について
naruse
0
450
tsserverとは何だったのか、これからどうなるのか
nowaki28
1
460
Oxcを導入して開発体験が向上した話
yug1224
4
290
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
510
ユニットテストの先へ:テスト技法で要求・仕様を整理するJava開発実践 / Beyond_Unit_Testing_Practical_Java_Development_Techniques_for_Organizing_Requirements_and_Specifications
shimashima35
0
370
Hunting Vulnerabilities in Symfony with LLMs
vinceamstoutz
0
430
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
110
oxlintはeslint/typescript-eslintを置き換えられるのか
shomafujita
2
330
気づいたらRubyで100作品 ー クリエイティブコーディングが生活の一部になるまで / 100 Ruby Sketches Later: How Creative Coding Became Part of My Life
chobishiba
3
550
JavaDoc 再入門
nagise
0
300
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.9k
jQueryをバージョンアップする前に使いたいjQuery Migrate
matsuo_atsushi
0
200
Featured
See All Featured
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
200
AI: The stuff that nobody shows you
jnunemaker
PRO
8
690
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.9k
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
160
VelocityConf: Rendering Performance Case Studies
addyosmani
333
25k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
200
Mobile First: as difficult as doing things right
swwweet
225
10k
How to Talk to Developers About Accessibility
jct
2
220
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
12
1.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.5k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
280
Six Lessons from altMBA
skipperchong
29
4.3k
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
!