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
1人で挑むSwiftコンパイラ 〜型システム入門編〜
s_shimotori
0
340
英語
s_shimotori
1
340
Parallel Socket Communication in Swift
s_shimotori
1
600
UIColor Anatomy
s_shimotori
1
2.2k
UIColor Cluster
s_shimotori
1
650
iOSDC Japan 2019 60 mins for color
s_shimotori
5
3.6k
wwdc19
s_shimotori
2
320
SE-0246 Generic Math(s) Functions
s_shimotori
2
2.4k
Introduction to Font and Typesetting
s_shimotori
4
3.7k
Other Decks in Programming
See All in Programming
大公開!iOS開発の悩みトップ5 〜iOSDC Japan 2024〜
ryunakayama
0
190
Regular Expressions, REXML, Automata Learning
makenowjust
0
220
マルチモジュールにおけるテスト最適化
fxwx23
0
210
rails_girls_is_my_gate_to_join_the_ruby_commuinty
maimux2x
0
200
Architecture Decision Record (ADR)
nearme_tech
PRO
1
680
Rechartsで楽にゴリゴリにカスタマイズする!
10tera
1
170
What is Parser
yui_knk
9
4.1k
Desafios e Lições Aprendidas na Migração de Monólitos para Microsserviços em Java
jessilyneh
2
150
【TID2024】模擬講義:プログラマと一緒にゲームをデザインしてみよう!
akatsukigames_tech
0
630
What you can do with Ruby on WebAssembly
kateinoigakukun
0
160
Go Code Generation at newmo / 2024-08-27 #newmo_layerx_go
genkey6
0
560
Lessons by WebAssembly app in production on CDN Edge Computing Service
tetsuharuohzeki
0
210
Featured
See All Featured
Visualization
eitanlees
142
15k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
GraphQLの誤解/rethinking-graphql
sonatard
65
9.8k
Design by the Numbers
sachag
277
19k
YesSQL, Process and Tooling at Scale
rocio
167
14k
Agile that works and the tools we love
rasmusluckow
327
20k
A Philosophy of Restraint
colly
202
16k
Building Adaptive Systems
keathley
36
2.1k
For a Future-Friendly Web
brad_frost
174
9.3k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.1k
Building Better People: How to give real-time feedback that sticks.
wjessup
359
18k
How to Ace a Technical Interview
jacobian
274
23k
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