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
88
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
140
Swift Attributes
hokuron
0
460
Peek in Calendar implementation of swift-foundation
hokuron
0
230
MVVM
hokuron
0
61
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
720
Clean Architecture 3
hokuron
0
69
Clean Architecture 2
hokuron
0
86
Other Decks in Programming
See All in Programming
条件判定に名前、つけてますか? #phperkaigi #c
77web
2
850
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
150
今こそ押さえておきたい アマゾンウェブサービス(AWS)の データベースの基礎 おもクラ #6版
satoshi256kbyte
1
200
ロボットのための工場に灯りは要らない
watany
12
3.2k
S3ストレージクラスの「見える」「ある」「使える」は全部違う ─ 体験から見た、仕様の深淵を覗く
ya_ma23
0
1.2k
CS教育のDX AIによる育成の効率化
niftycorp
PRO
0
170
The free-lunch guide to idea circularity
hollycummins
0
380
Geminiをパートナーに神社DXシステムを個人開発した話(いなめぐDX 開発振り返り)
fujiba
0
120
20260315 AWSなんもわからん🥲
chiilog
2
180
Cyrius ーLinux非依存にコンテナをネイティブ実行する専用OSー
n4mlz
0
250
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
140
今からFlash開発できるわけないじゃん、ムリムリ! (※ムリじゃなかった!?)
arkw
0
160
Featured
See All Featured
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
The Cost Of JavaScript in 2023
addyosmani
55
9.8k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
250
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
250
Building an army of robots
kneath
306
46k
Code Review Best Practice
trishagee
74
20k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.1k
Building Adaptive Systems
keathley
44
3k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9k
Accessibility Awareness
sabderemane
0
86
Git: the NoSQL Database
bkeepers
PRO
432
67k
Making Projects Easy
brettharned
120
6.6k
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
!