SE-XXXX Function Builders を読み解く / Reading the spec of Function Builders

SE-XXXX Function Builders を読み解く / Reading the spec of Function Builders

151a0b14f5914e786e2e104cfb3a9b2f?s=128

Kuniwak

July 08, 2019
Tweet

Transcript

  1. 4&9999
 'VODUJPO#VJMEFST
 ΛಡΈղ͘ Kuniwak - DeNA Co.,Ltd. 2019.07.08

  2. "CPVUNF

  3. ,VOJXBL w ॴଐˠ • github.com/Kuniwak • qiita.com/Kuniwak w ߏจղੳ΍୯ମςετ͕޷෺ w

    "QQ$PEF࢖͍ 3
  4. ࠓճ͓఻͍͑ͨ͜͠ͱ

  5. 4XJGU6*ͷཁૉٕज़Ͱ͋Δ
 'VODUJPO#VJMEFSTͷ
 ఏҊҙਤͱৄࡉΛֶͿ 5

  6. 6 @TupleBuilder func build() -> (Int, Int, Int) { 1

    2 3 } func build() -> (Int, Int, Int) { let _a = 1 let _b = 2 let _c = 3 return TupleBuilder.buildBlock(_a, _b, _c) } 'VODUJPO#VJMEFST͸্ΛԼʹίϯύΠϥ͕มܗ͢Δ࢓༷ʢະ֬ఆʣ
  7. w ໦Ϧετߏ଄ͷߏஙΛॿ͚Δ%4-తͳݴޠػೳΛೖΕ͍ͨ w Ϣʔβʔ͕ఆٛͷͨΊͷ!GVODUJPO#VJMEFSΞϊςʔγϣϯ ͱGVODUJPOCVJMEFSܕΛೖΕ·͢ w ίϯύΠϥ͕GVODUJPOCVJMEFSܕͷҾ਺ϒϩοΫ಺ͷ
 %4-ʢ4XJGUͷαϒηοτʣΛมܗͯ͠4XJGUݴޠ΁
 ຋༁ͯ͠ίϯύΠϧ͠·͢ ·ͱΊɿ'VODUJPO#VJMEFSTͱ͸

    7
  8. ൃදܗࣜ

  9. ຖिਫ༵೔ʹࣾ಺Ͱ։࠵͞Ε͍ͯΔɺ
 4XJGU8FEOFTEBZͱ͍͏ษڧձͱ
 ಉ͡ܗࣜͰΏΔΏΔΈ͍͖ͯ·͢ 9

  10. 10 4XJGU8FEOFTEBZൃͷ4XJGU΁ͷߩݙ

  11. Ͱ͸ݟ͍͖ͯ·͠ΐ͏

  12. https://forums.swift.org/t/important- evolution-discussion-of-the-new-dsl- feature-behind-swiftui/25168 12 TXJGUFWPMVUJPOͰͷެ։ͱಉ࣌ʹGPSVN΁QPTU͞ΕͨίϝϯτͰ͢ɻ

  13. https://github.com/apple/ swift-evolution/pull/1046 13 TXJGUFWPMVUJPO্Ͱ࠷৽ͷ΋ͷΛѻ͍·͢ɻ΋͔ͨ͠͠Β
 GPSVNͰ͞Βʹٞ࿦͕ਐΜͰ͍Δ͔΋͠Ε·ͤΜ͕͝༰͍ࣻͩ͘͞ɻ

  14. https://docs.swift.org/swift- book/ReferenceManual/ AboutTheLanguageReference.html 14 TUBUFNFOU΍FYQSFTTJPOΛ஌ΔͨΊͷࢿྉͰ͢ɻ

  15. w ໦Ϧετߏ଄ͷߏஙΛॿ͚Δ%4-తͳݴޠػೳΛೖΕ͍ͨ w Ϣʔβʔ͕ఆٛͷͨΊͷ!GVODUJPO#VJMEFS
 ΞϊςʔγϣϯͱGVODUJPOCVJMEFSܕΛೖΕ·͢ w ίϯύΠϥ͕GVODUJPOCVJMEFSܕͷҾ਺ϒϩοΫ಺ͷ
 %4-ʢ4XJGUͷαϒηοτʣΛมܗͯ͠4XJGUݴޠ΁
 ຋༁ͯ͠ίϯύΠϧ͠·͢ 'VODUJPO#VJMEFSTͱ͸

    15