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
iosdcrc_operator
Search
Shigure Shimotori
October 13, 2017
Programming
1
630
iosdcrc_operator
Swiftは何故か郵便屋さんを採用している話です #iOSDCRC
Shigure Shimotori
October 13, 2017
Tweet
Share
More Decks by Shigure Shimotori
See All by Shigure Shimotori
Synchronizationを支える技術
s_shimotori
1
180
1人で挑むSwiftコンパイラ 〜型システム入門編〜
s_shimotori
0
620
英語
s_shimotori
1
550
Parallel Socket Communication in Swift
s_shimotori
1
680
UIColor Anatomy
s_shimotori
1
2.4k
UIColor Cluster
s_shimotori
1
700
iOSDC Japan 2019 60 mins for color
s_shimotori
5
3.7k
wwdc19
s_shimotori
2
340
SE-0246 Generic Math(s) Functions
s_shimotori
2
2.4k
Other Decks in Programming
See All in Programming
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
340
nekko cloudにおけるProxmox VE利用事例
irumaru
3
430
「とりあえず動く」コードはよい、「読みやすい」コードはもっとよい / Code that 'just works' is good, but code that is 'readable' is even better.
mkmk884
3
460
rails stats で紐解く ANDPAD のイマを支える技術たち
andpad
1
290
ブラウザ単体でmp4書き出すまで - muddy-web - 2024-12
yue4u
3
480
Stackless и stackful? Корутины и асинхронность в Go
lamodatech
0
810
見えないメモリを観測する: PHP 8.4 `pg_result_memory_size()` とSQL結果のメモリ管理
kentaroutakeda
0
380
The Efficiency Paradox and How to Save Yourself and the World
hollycummins
1
450
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
330
良いユニットテストを書こう
mototakatsu
8
2.6k
Effective Signals in Angular 19+: Rules and Helpers @ngbe2024
manfredsteyer
PRO
0
140
Spatial Rendering for Apple Vision Pro
warrenm
0
110
Featured
See All Featured
Adopting Sorbet at Scale
ufuk
73
9.1k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
98
[RailsConf 2023] Rails as a piece of cake
palkan
53
5k
Thoughts on Productivity
jonyablonski
67
4.4k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
66k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
4 Signs Your Business is Dying
shpigford
181
21k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
How STYLIGHT went responsive
nonsquared
95
5.2k
Why Our Code Smells
bkeepers
PRO
335
57k
Building a Scalable Design System with Sketch
lauravandoore
460
33k
Transcript
iOSDC 2017 Reject Conference day1 ༣ศ͞Μͷԋࢉࢠ @S_Shimotori
ͩΕ • @S_Shimotori / @S_Shimotori_pub • ͭΒֶ͍ੜ • iOSDCؔ3
Custom Operators
ԋࢉࢠΛࣗ࡞ʂͨͷ͍͠ʂ • xmartlabs/Eureka • ϑΥʔϜϏϧμʔ • +++ͰSectionΛՃ͢ΔͳͲ • thoughtbot/Runes •
HaskellͰݟͨΑ͏ͳԋࢉࢠ͕͑ΔΑ͏ʹͳΔ
ͲΜͳԋࢉࢠ͕࡞ΕΔͷ͔ʁ
͜ΕΛݟ͓͚ͯᘳͰ͢ʂ
ͳΜͱͳʙ͘๏ଇ͕͋Δʂ
๏ଇͦͷ1
ͦͷ1: ͑ͦ͏ͳASCIIจࣈ͑Δ • ݟͨ͜ͱ͋ΔͷͰ΄΅શͯ • ڍ͛ΒΕ͍ͯͳ͍จࣈΛݟΕೲಘ͔ʁ • ɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹɹෆՄ • ɹ
dot operatorͰ༻Մ l 4USJOH-JUFSBMͰ༻ b LFZXPSEͷઌ಄Ͱ༻ JGͳͲ JNQMJDJUOBNFEQBSBNFUFSTͰ༻ ͳͲ \^ UVQMFɼGVODUJPOͳͲͰ༻ <> BSSBZMJUFSBMͳͲͰ༻ ܕͷݺͼग़͠ɼ࿈ଓ͢ΔPQFSBUPSͷׂͳͲͰ༻ ۠Γͱͯ͠༻ ! BUUSJCVUFͰ༻ !BWBJMBCMFͳͲ a Τεέʔϓ,FZ1BUI&YQSFTTJPOͰ༻ @ XJMEDBSEQBUUFSOͰ༻ A ༧ޠΛJEFOUJpFSʹ༻͍Δ࣌ʹ༻
๏ଇͦͷ2
ͦͷ2: identifierͰ͑Δจࣈجຊతʹ͑ͳ͍ • identifierͱoperatorผ • ઐ༻ͷΤϥʔ͕ଘࡏ͢Δ • • ͪΖΜΞϧϑΝϕοτࣈ༻ෆՄ •
༻ෆՄ ·Ί͖ͪ͠: ͜ͷΤϥʔจ۟ʮidentifier_when_expecting_operatorʯͷ໊Ͱ͔ͬ͠ΓSwiftʹ࣮͞Ε͍ͯ·͢ https://github.com/apple/swift/blob/bf42def404abcc9239cf7856475da2c80b86cc70/include/swift/AST/DiagnosticsParse.def#L421
❌ U+3008-U+3020, U+3030 ൣғμϒͬͯΔ͡ΌΜʁ U+3021-U+302Fɹ͕ ·Ί͖ͪ͠: U+3021-U+3029ોभ߸ᛰͱ͍͏ࣈɼU+302A-U+302Fͱ͔ූͱ͔ݺΕΔͷɽཁதࠃޠɽ ͱ͍͏͔U+3000-U+303Fࣗମ͕CJK Symbols and
Punctuationͱ͍͏ΧςΰϦɽ
๏ଇͦͷ3
ͦͷ3: ֶه߸͕݁ߏ͑Δ • ҹͱֶ͔ه߸ͱ͔͕·Δͬͱ͑Δ • mattt/Eulerͱ͍͏ϥΠϒϥϦ(?)͕͋Δ͘Β͍ • ɹɹɹɹ͑ͳ͍ ΄͔ଟ ਖ਼֬ʹ͍͏ͱɼUnicodeͰʮArrowsʯʮMathematical
OperatorsʯʮMiscellaneous TechnicalʯϒϩοΫͱݺΕ͍ͯΔͱ͜Ζ͕ ·Δ·Δ༻Մೳʹͳ͍ͬͯΔ
๏ଇͦͷ4
ͦͷ4 : ҙ֎ͱׅހϓϥΠϜ͕͑ͪΌ͏ • ASCIIจࣈͰμϝͰɼࣅͨจࣈ͕͑Δ͜ͱ͕͋Δ • • • • ٯʹ͍͏ͱׅހΫΥʔτͷྨม໊ʹ͑ͳ͍
๏ଇͦͷ5
ͦͷ5: ԋࢉࢠʹ͑Δֆจࣈ͋Δ • ͑ΔͷU+3030·ͰͷจࣈͷҰ෦ͱࢥͬͯOK • U+1F436ɼU+1F42E • ֆจࣈͷଟ͘U+1F000Ҏ߱Ͱൣғ֎ • U+3030Ҏલʹ͋Δֆจࣈ͑Δ͔ʂ
U+3030·ͰͷͲΕ͕ֆจࣈͳͷ͔ • The Unicode Consortium͕ܾΊ͍ͯΔ • ΄ͱΜͲ͕͑ΔͷͰɼҰཡΛݟͯωλΛ࿅Δͱྑ͠ • ͑ͳ͍ࢠ: •
U+FE0FͱU+FE0E͕ԋࢉࢠ໊ͷ2จࣈҎ߱Ͱ͑Δ • ͭ·ΓֆจࣈελΠϧͱςΩετελΠϧผѻ͍ Ұཡ http://unicode.org/Public/emoji/5.0/emoji-data.txt https://ja.wikipedia.org/wiki/Unicode%E3%81%AEEmoji%E3%81%AE%E4%B8%80%E8%A6%A7
͍͍ͩͨ͜Μͳײ͡ʂ
·ͱΊ • ͑ͦ͏ͳASCIIจࣈ͑Δ • identifierͰ͑Δจࣈجຊతʹ͑ͳ͍ • ֶه߸͕݁ߏ͑Δ • ҙ֎ͱׅހϓϥΠϜ͕͑Δ •
ಉ͡छྨͷจࣈ͕શ෦͑ΔΘ͚Ͱͳ͍ • ԋࢉࢠʹ͑Δֆจࣈ͋Δ
࠷ޙʹ͏1ͭ
࣍ͷจࣈԋࢉࢠʹ͑Δͷ͔ʁ ֆจࣈ͔Ͳ͏͔ ԋࢉࢠʹ͑Δ͔ ὺ ˟ ℗ ™ ℠
ֆจࣈ͔Ͳ͏͔ ԋࢉࢠʹ͑Δ͔ ὺ O : ˟ O : ⁴ O O : : : : ℗ O O ä : O ℠ O O
Θ͔ΒΜʂʂʂ
None