Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
わいわいOperator
Search
giginet
PRO
September 12, 2018
Programming
270
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
わいわいOperator
https://iosdiscord.connpass.com/event/97606/
giginet
PRO
September 12, 2018
Transcript
14 slides
Θ͍Θ͍Operator Θ͍Θ͍swiftc #5 @giginet
iOSDCͷLT !
• Protocol Extension͔ΒᤈࢠΛੜ͢Έ͍ͨͳωλΛͬͨ
͜Εpostfix operatorͰͰ͖ͳ͍ͷʁ !
import Foundation import Peafowl postfix operator ᤈ extension Int {
postfix static func ᤈ(lhs: Int) -> Tile { return Tile(.character(lhs))! } } 1ᤈ
None
ແཧͦ͏
ύʔαʔΛಡΉ • https://github.com/apple/swift/blob/master/include/swift/AST/ Identifier.h#L94
/// isOperatorStartCodePoint - Return true if the specified code point
is a /// valid start of an operator. static bool isOperatorStartCodePoint(uint32_t C) { // ASCII operator chars. static const char OpChars[] = "/=-+*%<>!&|^~.?"; if (C < 0x80) return memchr(OpChars, C, sizeof(OpChars) - 1) != 0; // Unicode math, symbol, arrow, dingbat, and line/box drawing chars. return (C >= 0x00A1 && C <= 0x00A7) || C == 0x00A9 || C == 0x00AB || C == 0x00AC || C == 0x00AE || C == 0x00B0 || C == 0x00B1 || C == 0x00B6 || C == 0x00BB || C == 0x00BF || C == 0x00D7 || C == 0x00F7 || C == 0x2016 || C == 0x2017 || (C >= 0x2020 && C <= 0x2027) || (C >= 0x2030 && C <= 0x203E) || (C >= 0x2041 && C <= 0x2053) || (C >= 0x2055 && C <= 0x205E) || (C >= 0x2190 && C <= 0x23FF) || (C >= 0x2500 && C <= 0x2775) || (C >= 0x2794 && C <= 0x2BFF) || (C >= 0x2E00 && C <= 0x2E7F) || (C >= 0x3001 && C <= 0x3003) || (C >= 0x3008 && C <= 0x3030); }
None
·ͱΊ • operatorͰ͑Δจࣈίʔυܾ·ͬͯΔ • ϙϯυoperatorʹͰ͖Δ͕ɺϢʔϩoperatorʹͰ͖ͳ͍ • ଞʹ͋Δ͔
ΦϚέ • ࣮ṛશͯUnicodeʹׂΓͯΒΕ͍ͯΔ • ͜ΕΦϖϨʔλʔʹͰ͖ͳ͍ʁ
ແཧͩͬͨ
ΦϚέ2 • ṛΛఆ͢ΔCharacterSetͰ͢ import Foundation public let MahjongTileCharacterSet = {
() -> CharacterSet in let start = Character("").unicodeScalars.first! let end = Character("").unicodeScalars.first! let range: ClosedRange<Unicode.Scalar> = start...end return CharacterSet(charactersIn: range) }()
More Decks by giginet
See All by giginet
🀄️ on swiftc
giginet
PRO
0
650
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
520
Claude Codeログ基盤の構築
giginet
PRO
7
4.8k
Inside of Swift Export
giginet
PRO
1
3.6k
Swiftビルド弾丸ツアー - Swift Buildが作る新しいエコシステム
giginet
PRO
0
3.1k
SwiftでMCPサーバーを作ろう!
giginet
PRO
3
510
Creating Intuitive Developer Tool in Swift
giginet
PRO
0
1.7k
Mergeable Libraryで 高速なアプリ起動を実現しよう!
giginet
PRO
2
8.8k
5分でわかるExplicitly Built Modules
giginet
PRO
2
2k
Other Decks in Programming
See All in Programming
Distance field of Julia set
kinakomoti321
0
330
あなたはMCPの機能を、まだ知らない。
4geru
1
700
DroidKnights 2026 Android A2UI Jetpack Compose 기반의 안전한 AI UI 렌더링 - 박제창
itsmedreamwalker
1
260
Vapor Mode でアクセシビリティは 壊れないか検証した話
fuqda
1
350
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
300
小さなアプリを作って公開するまで
onozaty
0
210
社内AIエージェント「Askワンバン」における コストチューニングの取り組み
t0yohei
0
180
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
390
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
210
SODA - FACT BOOK(EN)
sodainc
1
270
どうしても Eloquent でリポジトリパターンをやりたいんだ #phpcon_niigata / phpcon-niigata-2026
shogogg
0
660
AI時代のIaC入門 〜なぜインフラをコードで管理したいのか?〜 / Introduction to IaC in the AI Era
akihisaikeda
6
1.6k
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
610
Rails Girls Zürich Keynote
gr2m
96
14k
Skip the Path - Find Your Career Trail
mkilby
1
300
Conquering PDFs: document understanding beyond plain text
inesmontani
PRO
4
3.3k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.8k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
39
3.5k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
2
6.5k
How to Talk to Developers About Accessibility
jct
2
630
Embracing the Ebb and Flow
colly
88
5.2k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
670
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k