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
620
iosdcrc_operator
Swiftは何故か郵便屋さんを採用している話です #iOSDCRC
Shigure Shimotori
October 13, 2017
Tweet
Share
More Decks by Shigure Shimotori
See All by Shigure Shimotori
英語
s_shimotori
1
220
Parallel Socket Communication in Swift
s_shimotori
0
520
UIColor Anatomy
s_shimotori
1
2.2k
UIColor Cluster
s_shimotori
1
610
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.3k
Introduction to Font and Typesetting
s_shimotori
4
3.7k
Swift Enumeration is so useful
s_shimotori
2
460
Other Decks in Programming
See All in Programming
CSC307 Lecture 11
javiergs
PRO
0
240
유연한 Composable 설계
l2hyunwoo
0
380
さきがけから振り返るアーキテクチャ刷新 / Reflecting on the Architectural Renewal from the Vanguard
nrslib
2
770
AHC035解説
terryu16
0
710
今こそ始める、CDKコンストラクトライブラリ開発 ― 入門から実践まで
tmokmss
1
930
Namespace on read
tagomoris
2
370
GraphQL はいいぞ! ~Laravel で学ぶ GraphQL 入門~
azuki
1
160
Introduction to GitOps
hwchiu
0
110
リハビリmruby
kishima
1
160
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
HMSコンペ 11th Solution (team : kansai-kaggler)
t88
1
680
Jetpack for KMP
fornewid
1
290
Featured
See All Featured
Why Our Code Smells
bkeepers
PRO
332
56k
Clear Off the Table
cherdarchuk
89
320k
A better future with KSS
kneath
231
17k
Bash Introduction
62gerente
607
210k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Mobile First: as difficult as doing things right
swwweet
219
8.8k
Testing 201, or: Great Expectations
jmmastey
33
6.9k
Typedesign – Prime Four
hannesfritz
37
2.2k
Learning to Love Humans: Emotional Interface Design
aarron
269
39k
In The Pink: A Labor of Love
frogandcode
139
22k
GitHub's CSS Performance
jonrohan
1026
450k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
18
1.2k
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