$30 off During Our Annual Pro Sale. View Details »

私が愛する Elixir/Erlang の楽しさと辛さ

cooldaemon
February 15, 2019

私が愛する Elixir/Erlang の楽しさと辛さ

Developers Summit 2019 にて, Web エンジニアの皆様向けに Elixir の紹介をした際に使用したスライドです.

https://event.shoeisha.jp/devsumi/20190214/session/1996/

デブサミ 2019 年テーマ「SHARE YOUR FUN!」に則り、私が 15 年間にわたり愛し続けている Erlang や Elixirを、まだ、これらに触れたことがない PHP/Java/JavaScript などが得意な Web エンジニアの方々へ共有します。

ゴールは、ご参加いただける皆様の道具箱に Elixir を追加する準備を整えることです。

他の言語と比較して何が良いのか?辛いのか?(継続、イベントドリブン、オブジェクト指向、プロセスデザイン、マクロなど)に触れていき、皆様の期待値を適切に保った状態でElixir の世界へと誘います。

cooldaemon

February 15, 2019
Tweet

More Decks by cooldaemon

Other Decks in Technology

Transcript

  1. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࢲ͕Ѫ͢Δ Elixir/Erlang ͷָ͠͞ͱਏ͞ Developers Summit 2019 15-D-5

    ͜ΕΛ·ͩ஌Βͳ͍8FCΤϯδχΞ΁ଃΔ ೥݄೔ HVNJ*OD$50زాխਔ
  2. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ձࣾ঺հ ೥ ઃཱ ೥ ήʔϜೝূ՝ۚαʔϏεʹ &SMBOHΛ࠾༻ ೥

    ήʔϜৗ࣌઀ଓαʔόʹ &SMBOHΛ࠾༻ ೥ ήʔϜೝূ՝ۚαʔϏεʹ &MJYJSΛ࠾༻ ೥ ήʔϜ"1*αʔόʹ &MJYJSΛ࠾༻ ೥ ΠϚίί
  3. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࣗݾ঺հ زాխਔ ͍ͨ͘ ·͞ͻͱ زాխਔ ͍ͨ͘ ·͞ͻͱ

    ೥ &SMBOHͱग़ձ͏ ೥ &SMBOHͰ ΫϨδοτܾࡁαʔϏεΛߏங ೥ HVNJ*OD΁ೖࣾ͢Δ ೥ &SMBOHͰ ήʔϜೝূ՝ۚαʔϏεΛߏங ೥ &MJYJSͱग़ձ͏ ೥ HVNJ*OD$50ʹͳΔ ೥ +BQBO&MJYJS"TTPDJBUJPO΁ࢀՃ ࣾ಺Ͱ&MJYJS࠾༻Λڣͼ࢝ΊΔ ೥ ΠϚίί
  4. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ ૉૣ͘ϦϦʔε͍ͨ͠ ૿͑ଓ͚ΔΫϥΠΞϯτ ංେԽ͢Δαʔόߏ੒ 8FC։ൃऀͷ೰Έ ෳࡶԽ͢Δίʔυ ߨٛϊʔτ

    ɹίʔυͷՄಡੑΛམͱͯ͠ ॲཧੑೳҐΛ্͛Δ͜ͱ΋͋Δ FH ετΞΛਫฏ෼ׂ εϨου΍ίϧʔνϯ
  5. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ ૉૣ͘ϦϦʔε͍ͨ͠ ૿͑ଓ͚ΔΫϥΠΞϯτ ංେԽ͢Δαʔόߏ੒ ෳࡶԽ͢Δαʔόߏ੒ 8FC։ൃऀͷ೰Έ ෳࡶԽ͢Δίʔυ

    ߨٛϊʔτ ɹϢʔβಉ࢜ͷΠϯλϥΫγϣϯ͕૿͑ΔΑ͏ͳϏδωεཁ݅Λຬ ͨͨ͢Ί ৗ࣌઀ଓ ͔ͭ εςʔτϑϧͳߏ੒ΛՃ͑Δ͜ͱ΋͋Δ ɹ݁Ռʜ
  6. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ 8FC։ൃऀͷ೰Έ ૉૣ͘ϦϦʔε͍ͨ͠ ૿͑ଓ͚ΔΫϥΠΞϯτ ංେԽ͢Δαʔόߏ੒ ෳࡶԽ͢Δαʔόߏ੒ A

    ฒߦੑ ߨٛϊʔτ ɹΞΫηε਺͕૿͑ͯ΋ ߏ੒͕ංେԽ͠ͳ͍Α͏ ฒߦॲཧͷ࢓૊ Έ͕ଘࡏ͍ͯ͠Δ͜ͱ
  7. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ 8FC։ൃऀͷ೰Έ ૉૣ͘ϦϦʔε͍ͨ͠ ૿͑ଓ͚ΔΫϥΠΞϯτ ංେԽ͢Δαʔόߏ੒ ෳࡶԽ͢Δαʔόߏ੒ A

    ฒߦੑ ϝϯςϯφϯεੑ ߨٛϊʔτ ɹΞΫηε਺ʹ഑ྀͨ͠ίʔυΛهड़ͯ͠΋ ίʔυ͕ෳࡶԽͤͣ  ϝϯςφϯεੑ͕ଛͳΘΕͳ͍࢓૊Έ͕ଘࡏ͍ͯ͠Δ͜ͱ
  8. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ 8FC։ൃऀͷ೰Έ ૉૣ͘ϦϦʔε͍ͨ͠ ૿͑ଓ͚ΔΫϥΠΞϯτ ංେԽ͢Δαʔόߏ੒ ෳࡶԽ͢Δαʔόߏ੒ A

    ฒߦੑ ϝϯςϯφϯεੑ ଱ো֐ੑ ߨٛϊʔτ ɹো֐ରԠͷίετΛԼ͛ΔͨΊʹ ҆શੑʹ഑ྀͨ͠࢓૊Έ͕ଘ ࡏ͍ͯ͠Δ͜ͱ
  9. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ HVNJ*OD ͓ख఻͍ͷ࣮ྫ ϚΠΫϩαʔϏε܈ ήʔϜαʔό܈ 1SPYZ 0DVMVT4UPSF

    'BDFCPPL ʜ 1VC4VC "1* ೝূ ՝ۚ ഑৴ ഑৴ελδΦ 6OJUZ IUUQTWBSLDPKQ ˡ৽ن։ൃ ࡾϲ݄͘Β͍ ϓϥοτϑΥʔϜ܈
  10. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ ฒߦੑ ϝϯςφϯεੑ ଱ো֐ੑʹ༏Εͨ 8FCαʔϏεΛ ։ൃͰ͖Δੈք΁ 

    Α͏ͦ͜ʂ 3VCZ  /PEFKT  4DBMB  &MJYJS  ๭ٻਓαΠτਖ਼ࣾһٻਓ਺ ೥݄೔ݱࡏ ݅ ݅ ݅ ݅
  11. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ࠓ೔ͷ࿩͠ ֶशίετ͕ߴ͍ ͱࢥΘΕ͍ͯΔ ؔ਺ܕ ϚΫϩ &SMBOH

    ߨٛϊʔτ ɹฒߦॲཧ ؔ਺ܕ ϚΫϩͱ೉ͦ͠͏ͳ֓೦ΛֶͿඞཁ͕͋Γͦ͏ ͳͱ͜Ζʹ ͳͥʹೋͭ໨ͷݴޠΛֶͿඞཁ·Ͱ͋Δͷ͔ʜ  ɹී௨ʹߟ͑ͨΒ ࠾༻Λආ͚·͢ΑͶ
  12. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࠓ೔ͷ࿩͠ ֶशίετ͕ߴ͍ &MJYJS͸ֶशίετͷׂʹ͸ Ըܙ͕େ͖͍ ࣋ͪؼͬͯ΄͍͜͠ͱ ҆શੑ͕ߴ͘ ੜ࢈ੑ͕ߴ͘

    ͦΕҎ֎ͷੑ࣭͸ ΄Ͳྑ͍ ࠓ೔࿩͢͜ͱ ͸ߴ͘΋௿͘΋ͳ͍ 8FCγεςϜͷ։ൃͳΒ͹ Ճ͑ͯʜ ྑ͍͜ͱ΋ѱ͍͜ͱ΋࿩͢
  13. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ 8"3/*/( زాͷ࿩͕͠ղΓ೉͍ͧʜͱࢥͬͨΒ ֶशίετΛׂ͘ Ϧετͷѻ͍ํ ֶͿ͜ͱΛऔࣺબ୒ֶͯ͠शίετΛԼ͛Δ ߨٛϊʔτ

    ɹ͸͡Ίʹ Ϧετૢ࡞ͷशಘʹ࣌ؒΛׂ͘ ɹϦετૢ࡞͸ &MJYJSͷجૅͱ͍͏ΑΓ ϓϩάϥϛϯάߦҝશൠ Ͱසग़͢Δύλʔϯ։ൃର৅΍ݴޠʹґଘͤͣ Ԡ༻͕ޮͨ͘Ί  &MJYJSΛΩοΧέʹֶͿͱΑ͍
  14. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ 8"3/*/( زాͷ࿩͕͠ղΓ೉͍ͧʜͱࢥͬͨΒ ֶशίετΛׂ͘ Ϧετͷѻ͍ํ ͠͹Β͘ ֶशίετΛׂ͔ͳ͍

    ฒߦॲཧશൠ ϚΫϩશൠ ϏϔΠϏΞͱϓϩτίϧ ֶͿ͜ͱΛऔࣺબ୒ֶͯ͠शίετΛԼ͛Δ ߨٛϊʔτ ɹฒߦॲཧ ϚΫϩ ϏϔΠϏΞ ϓϩτίϧ͸ ࠷ޙʹֶͿ ɹԿނ ͠͹Βֶ͘शෆཁ͔͸ ຊࢿྉͷதͰղઆ͢Δ ɹ͜͜Ͱ঺հͨ͠Ҏ֎ͷ߲໨͸ Ϧετૢ࡞ʹशख़͔ͯ͠ΒֶͿ
  15. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ᷿Ͱᷚ͞Ε͍ͯΔྑ͍࿩͠ ΞΫλʔϞσϧʂ ϝοηʔδύογϯάʂ ϝϞϦΛڞ༗͠ͳ͍͔Β γϯϓϧ ֓೦ࣗମͷֶशʹ

    ίετ͕ඞཁ ϝοηʔδύογϯά Ͱ͢Βਓྨʹ͸ૣ͔ͬͨ ᷿Ͱᷚ͞Ε͍ͯΔѱ͍࿩͠ ڞ༗ϝϞϦ εϨουΑΓָ͚ͩͲ
  16. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ᷿Ͱᷚ͞Ε͍ͯΔྑ͍࿩͠ ΞΫλʔϞσϧʂ ϝοηʔδύογϯάʂ ϝϞϦΛڞ༗͠ͳ͍͔Β γϯϓϧ ֓೦ࣗମͷֶशʹ

    ίετ͕ඞཁ ϝοηʔδύογϯά Ͱ͢Βਓྨʹ͸ૣ͔ͬͨ ᷿Ͱᷚ͞Ε͍ͯΔѱ͍࿩͠ ڞ༗ϝϞϦ εϨουΑΓָ͚ͩͲ A લఏ৚݅Λ มߋ ·ͯʂ
  17. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ % wc -l */**.ex | tail

    -1 39053 total % ag spawn | wc -l 0 % ag Task | wc -l 0 % ag ‘ Agent’ | wc -l 0 % ag GenServer | wc -l 0
  18. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ &7. &SMBOH7. 04 FH-JOVY #4%ʜ $PXCPZ8FC4FSWFS

    FH/HJOY "QBDIFʜ JFY4IFMM FH'JTI ;TIʜ ஞ࣍ॲཧΛ ॻ͚ͩ͘Ͱ ܰྔϓϩηεͷ ԸܙΛ ڗडͰ͖Δ
  19. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ Ͳ͏͍͏͜ͱʁ An erlang web server will

    spawn a single process per connection - each process is in itself a complete little web server - if you are running mochiweb with 100K chat sessions you really have 100K web servers on your machine - not one. If one of these web servers crashes who cares. +PF"SNTUSPOH (http://j.mp/mfpkYo)
  20. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ Ͳ͏͍͏͜ͱʁ An erlang web server will

    spawn a single process per connection - each process is in itself a complete little web server - if you are running mochiweb with 100K chat sessions you really have 100K web servers on your machine - not one. If one of these web servers crashes who cares. +PF"SNTUSPOH (http://j.mp/mfpkYo) ߨٛϊʔτ ɹ+PF"SNTUSPOH&SMBOH։ൃऀͷҰਓ ɹϝʔϦϯάϦετͷલޙͷจ຺͕໘ന͍ͨΊ ͥͻ ݪจΛࢀর͠ ͯ΄͍͠೔ຊޠͰ͋Ε͹LVFOJTIJ͞Μͷهࣄ͕ৄ͍͠
  21. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ Ͳ͏͍͏͜ͱʁ +PF"SNTUSPOH (http://j.mp/mfpkYo) Erlang Ͱ࡞ΒΕͨ Web

    αʔό͸, Ұͭͷ઀ଓ͝ͱʹ, Ұͭͷ ϓϩηεΛੜ੒͢Δ. 10ສݸͷνϟοτͷηογϣϯ͕ඞཁ ͳΒ, 10ສݸͷ Web αʔό͕ىಈ͢Δ. Ծʹ, ͦͷதͷҰͭ ͕མͪͨͱͯ͠΋, ୭΋ؾʹ͠ͳ͍.
  22. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ Ͳ͏͍͏͜ͱʁ &7. $PXCPZϓϩηε )551ϦΫΤετ ࢲͨͪͷ ஞ࣍ॲཧϓϩηε

    )551ηογϣϯ ϓϩηεىಈ ߨٛϊʔτ ɹ࣮ࡍ͸ ޮ཰ԽͷͨΊʹىಈࡁΈͷϓϩηεΛׂΓ౰͍ͯͯΔ͕  આ໌؆ུԽͷͨΊ ϓϩηεىಈͱ͍͏දݱʹ͍ͯ͠Δ
  23. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ Ͳ͏͍͏͜ͱʁ &7. $PXCPZϓϩηε ࢲͨͪͷ ஞ࣍ॲཧϓϩηε )551ϦΫΤετ

    ϓϩηεىಈ )551ηογϣϯ 04ͬΆ͍ 8FC4FSWFSͩ $(*ͬΆ͍ ߨٛϊʔτ ɹ&7.ͱ$PXCPZ͕ฒߦॲཧΛ༻͍ͯ ॲཧޮ཰Λ্͍͛ͯΔ ɹ8FCαʔϏε։ൃऀ͸ ஞ࣍ॲཧΛهड़͢Δ͚ͩͰΑ͍
  24. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ Ͳ͏͍͏͜ͱʁ &7. &SMBOH7. 04 FH-JOVY #4%ʜ

    $PXCPZ8FC4FSWFS FH/HJOY "QBDIFʜ JFY4IFMM FH'JTI ;TIʜ &7. 04
  25. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); }
  26. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } ߨٛϊʔτ ɹͨͱ͑͹ ͜ͷΑ͏ͳ+BWB4DSJQUͷίʔυ͕͋ͬͨͱ͢Δ
  27. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); }
  28. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } ߨٛϊʔτ ɹ͜ͷίʔυΛهड़͢Δࡍ ։ൃऀ͸ ࣍ͷΑ͏ͳ͜ͱΛߟ͍͑ͯΔ
  29. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ function do_process(orders) { _.each(orders, (order) =>

    { const result = do_something1(order); return do_something2(result); }); } ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ʜ
  30. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ʜ function do_process(orders) {

    _.each(orders, (order) => { const result = await do_something1(order); return await do_something2(result); }); }
  31. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ΒFBDIʹ౉͢ແ໊ؔ਺͸BTZODʹ͢Δ͔ʜ ;ʔΉʜϧʔϓͷ౓ʹೋճίϯςΩετ͕੾ΓସΔͷ͔ʜ ͋ ଴ͪ߹Θͤ͠ͳ͍ͱʜFBDIΛNBQʹͯʜ

    SZ async function do_process(orders) { const promises = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); }
  32. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ΒFBDIʹ౉͢ແ໊ؔ਺͸BTZODʹ͢Δ͔ʜ ;ʔΉʜϧʔϓͷ౓ʹೋճίϯςΩετ͕੾ΓସΔͷ͔ʜ ͋ ଴ͪ߹Θͤ͠ͳ͍ͱʜFBDIΛNBQʹͯʜ

    SZ ͋͹͹PSEFSTͷॲཧॱ൪͸อূ͞Εͳ͍͔΋ʜ async function do_process(orders) { const promises = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); }
  33. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ΒFBDIʹ౉͢ແ໊ؔ਺͸BTZODʹ͢Δ͔ʜ ;ʔΉʜϧʔϓͷ౓ʹೋճίϯςΩετ͕੾ΓସΔͷ͔ʜ ͋ ଴ͪ߹Θͤ͠ͳ͍ͱʜFBDIΛNBQʹͯʜ

    SZ ͋͹͹PSEFSTͷॲཧॱ൪͸อূ͞Εͳ͍͔΋ʜ async function do_process(orders) { const promises = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } ΠϕϯτυϦϒϯ ܧଓ͸ ίϯςΩετεΠονͷ ੾Γସ͕͑ ্Ґ૚ʹ࿙Εग़͍ͯ͠Δ
  34. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ΒFBDIʹ౉͢ແ໊ؔ਺͸BTZODʹ͢Δ͔ʜ ;ʔΉʜϧʔϓͷ౓ʹೋճίϯςΩετ͕੾ΓସΔͷ͔ʜ ͋ ଴ͪ߹Θͤ͠ͳ͍ͱʜFBDIΛNBQʹͯʜ

    SZ ͋͹͹PSEFSTͷॲཧॱ൪͸อূ͞Εͳ͍͔΋ʜ async function do_process(orders) { const promises = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } ΠϕϯτυϦϒϯ ܧଓ͸ ίϯςΩετεΠονͷ ੾Γସ͕͑ ্Ґ૚ʹ࿙Εग़͍ͯ͠Δ ߨٛϊʔτ ɹܧଓ͸ ΠϕϯτɾυϦϒϯͷՄಡੑΛ্͛Δख๏ͱͯ͠༻͍Δ͜ ͱ΋Ͱ͖Δ͜ͷख๏͸ +BWB4DSJQU͚ͩͰ͸ͳ͘ 1FSM΍ 4DBMBͰ΋༻͍ΒΕ͍ͯΔ1FSM$PSP "OZ&WFOU΍"LLB  4DBMB$14ͳͲ
  35. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ΒFBDIʹ౉͢ແ໊ؔ਺͸BTZODʹ͢Δ͔ʜ ;ʔΉʜϧʔϓͷ౓ʹೋճίϯςΩετ͕੾ΓସΔͷ͔ʜ ͋ ଴ͪ߹Θͤ͠ͳ͍ͱʜFBDIΛNBQʹͯʜ

    SZ ͋͹͹PSEFSTͷॲཧॱ൪͸อূ͞Εͳ͍͔΋ʜ async function do_process(orders) { const promises = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } ΠϕϯτυϦϒϯ ܧଓ͸ ίϯςΩετεΠονͷ ੾Γସ͕͑ ্Ґ૚ʹ࿙Εग़͍ͯ͠Δ ߨٛϊʔτ ɹܧଓ ΠϕϯτɾυϦϒϯΛ։ൃऀʹهड़͍ͤͯ͞Δ࣌఺Ͱ Լ Ґͷ֓೦্͕Ґʹ࿙Εग़͍ͯ͠Δ ɹࣅͨྫΛڍ͛ΔͳΒ ($ͰϝϞϦΛ։์͢ΔͨΊ ࣗྗͰࢀরΧ ΢ϯτΛૢ࡞͢ΔͳͲʜ
  36. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ΉΉʜEP@TPNFUIJOH ͸BTZOD͔ʜ BXBJUͰݺͿ͔ΒFBDIʹ౉͢ແ໊ؔ਺͸BTZODʹ͢Δ͔ʜ ;ʔΉʜϧʔϓͷ౓ʹೋճίϯςΩετ͕੾ΓସΔͷ͔ʜ ͋ ଴ͪ߹Θͤ͠ͳ͍ͱʜFBDIΛNBQʹͯʜ

    SZ ͋͹͹PSEFSTͷॲཧॱ൪͸อূ͞Εͳ͍͔΋ʜ async function do_process(orders) { const promises = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); }
  37. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } def do_process(orders) do orders |> Enum.map(fn (order) -> order |> do_something1 |> do_something2 end) end
  38. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } def do_process(orders) do orders |> Enum.map(fn (order) -> order |> do_something1 |> do_something2 end) end ߨٛϊʔτ ɹ&MJYJSͰ͋Ε͹ ಉ͡ॲཧΛ ؆୯ͳஞ࣍ॲཧͱͯ͠هड़Ͱ͖Δ ʮͲ͜ͰίϯςΩετ͕੾ΓସΘΔʯͷ͔ߟྀ͕ෆཁ
  39. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ async function do_process(orders) { const promises

    = _.map(orders, async (order) => { const result = await do_something1(order); return await do_something2(result); }); return await Promise.all(promises); } def do_process(orders) do orders |> Enum.map(fn (order) -> order |> do_something1 |> do_something2 end) end
  40. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ def do_process(orders) do orders |> Enum.map(fn

    (order) -> order |> do_something1 |> do_something2 end) end def do_process(orders) do orders |> Enum.map(&do_something1/1) |> Enum.map(&do_something2/1) end
  41. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ def do_process(orders) do orders |> Enum.map(fn

    (order) -> order |> do_something1 |> do_something2 end) end def do_process(orders) do orders |> Enum.map(&do_something1/1) |> Enum.map(&do_something2/1) end ߨٛϊʔτ ɹॲཧॱ͕มΘͬͯΑ͍ͳΒ ͜ͷΑ͏ʹ΋هड़Ͱ͖Δ
  42. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ಠཱͨ͠$16Λ࣋ͭ ฒߦॲཧ Ͳ͏࣮ݱ͍ͯ͠Δͷ͔ ܰྔ ϓϩηε ܰྔ ϓϩηε

    ܰྔ ϓϩηε ܰྔ ϓϩηε ʜ $16 ʜ ܰྔ ϓϩηε 04 $16 $16 &7. ܰྔϓϩηε$16
 /.
  43. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ಠཱͨ͠$16Λ࣋ͭ ฒߦॲཧ Ͳ͏࣮ݱ͍ͯ͠Δͷ͔ ܰྔ ϓϩηε ܰྔ ϓϩηε

    ܰྔ ϓϩηε ܰྔ ϓϩηε ʜ $16 ʜ εϨου εέδϡʔϥʔ ʜ ʜ ܰྔ ϓϩηε 04 $16 $16 εϨου εέδϡʔϥʔ εϨου εέδϡʔϥʔ εϨου εέδϡʔϥʔ ܰྔϓϩηε$16
 /.
  44. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ಠཱͨ͠$16Λ࣋ͭ ฒߦॲཧ Ͳ͏࣮ݱ͍ͯ͠Δͷ͔ ܰྔ ϓϩηε ܰྔ ϓϩηε

    ܰྔ ϓϩηε ܰྔ ϓϩηε ʜ $16 ʜ εϨου εέδϡʔϥʔ ʜ ʜ ܰྔ ϓϩηε 04 $16 $16 εϨου εέδϡʔϥʔ εϨου εέδϡʔϥʔ εϨου εέδϡʔϥʔ ܰྔϓϩηε$16
 /. ߨٛϊʔτ ɹ&7.͕࣋ͭεέδϡʔϥʔ͸ 04εϨουͱҰରҰ ɹৄࡉ͸ল͕͘ εέδϡʔϥʔຖʹλεΫͷΩϡʔΛ࣋ͪ ࣗ෼ͷ Ωϡʔ͕ۭʹͳΔͱ ଞॴͷΩϡʔ͔ΒλεΫΛୣ͏ ɹৄࡉ͸ UIF#&".#PPL IUUQTKNQ)0&D/ ࢀর
  45. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ωοτϫʔΫ্ͷҰҙͳॅॴΛ࣋ͭ ฒߦॲཧ ͱ͸͍͑ʁ Ұൠతͳ04্Ͱߴස౓ʹ࠶ىಈ͢Δ ϓϩηε͕͋Δͱ૝૾ͯ͠΄͍͠ ϓϩηεىಈෛՙͳͲʹΑΓ ো֐ʹൃల͢Δࣄ͕ଟ͘

    ආ͚Δඞཁ͕͋Δ ߨٛϊʔτ ɹߴස౓ʹ࠶ىಈ͢Δͱ$16ෛՙ্͕͕Δ ɹ&DUP͕ґଘ͍ͯ͠Δ%#$POOFDUJPO΍ 3FEJTΫϥΠΞϯτ 3FEJY͸ αʔόͱίωΫγϣϯ͕੾Εͯ΋ ϓϩηεΛΫϥογϡ ͤͣ ϓϩηεΛ࢖͍ճ͢Α͏ʹͳ͍ͬͯΔ
  46. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ωοτϫʔΫ্ͷҰҙͳॅॴΛ࣋ͭ ฒߦॲཧ ͱ͸͍͑ʁ Ұൠతͳ04্Ͱߴස౓ʹ࠶ىಈ͢Δ ϓϩηε͕͋Δͱ૝૾ͯ͠΄͍͠ ϓϩηεىಈෛՙͳͲʹΑΓ ো֐ʹൃల͢Δࣄ͕ଟ͘

    ආ͚Δඞཁ͕͋Δ ߨٛϊʔτ ɹ઀ଓঢ়ଶ͸ ਖ਼ৗܥͷʮঢ়ଶʯͱͯ͠؅ཧ͢ΔͱΑ͍ ɹͨͩ͠ ϓϩηεΛ࢖͍ճ͢ͱ ϓϩηεఀࢭʹΑΔϝϞϦղ์͕ ߦΘΕͳ͍ͨΊ ϝϞϦϦʔΫ͠ͳ͍Α͏ؾΛ഑Δඞཁ͕͋Δ
  47. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ҆શୈҰ ฒߦॲཧ &7.ʹ04ͱࣅͨϓϩηεͷ࢓૊ΈΛ࣋ͭ ݁Ռͱͯ͠ʜ ܰྔϓϩηε͸଱ো֐ੑͷ޲্ ͢ΔͨΊͷ࢓૊Έ ߨٛϊʔτ

    ɹ೥ &7.Λ஌ͬͯײಈͨ͠ ɹϓϩηε͸ ҆શੑΛ୲อ͢Δ࢓૊Έͩͬͨͷ͔ʂʁͱᡰʹམͪ ͨࢲ͸ ଎౓΍ޮ཰Խ͚ͩΛ௥͍ٻΊ͍ͯͨͨΊ িܸΛड͚ͨ ɹ4-"͸ҏୡͰ͸ͳ͍
  48. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE $ +BWB /PEFKTΑΓ஗͍ ฒߦॲཧ &7.ʹ04ͱࣅͨϓϩηεͷ࢓૊ΈΛ࣋ͭ ଎͞ IUUQTKNQ$"R",D

    1ZUIPO 3VCZ 1)1ΑΓ଎͍ ७ਮͳҰϓϩηεʹΑΔܭࢉ͸ʜ 04ͱࣅͨ͜ͱΛ͍ͯ͠Δͷʹ଎͍Θ͚͕ͳ͍
  49. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE $ +BWB /PEFKTΑΓ஗͍ ฒߦॲཧ &7.ʹ04ͱࣅͨϓϩηεͷ࢓૊ΈΛ࣋ͭ ଎͞ IUUQTKNQ$"R",D

    1ZUIPO 3VCZ 1)1ΑΓ଎͍ 04ͱࣅͨ͜ͱΛ͍ͯ͠Δͷʹ଎͍Θ͚͕ͳ͍ ߨٛϊʔτ ɹωλ ɹ/PEFKT͸ ଞͷಈతݴޠͱൺֱ͢Δͱ ѹ౗తʹ଎͍ ɹ͜Ε͸ ΠϕϯτɾυϦϒϯ͔ͩΒͱ͍͏ཧ༝Ͱ͸ͳ͍ ɹ7͕ؤு͍ͬͯΔ $IBDLSB$PSFͷ͜ͱ͸ෆษڧͰ஌Βͳ͍ ७ਮͳҰϓϩηεʹΑΔܭࢉ͸ʜ
  50. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧͷֶशίετෆཁͰ ΄Ͳ΄Ͳʹ஗͘ͳ͍ ͱͯ΋ָͰ҆શͳݴޠ&MJYJS ฒߦॲཧ &7.ʹ04ͱࣅͨϓϩηεͷ࢓૊ΈΛ࣋ͭ ݁Ռͱͯ͠ʜ ߨٛϊʔτ

    ɹฐࣾͷ&SMBOHͰهड़͞ΕͨαʔϏε͸ ࢲͷෆಙͷக͢ͱ͜Ζ Ͱ Ξϯνύλʔϯ΍ෆਖ਼ͳΞϓϩʔνͰृ͘ଠ͕ͬͨ ͦΕͰ΋ 4-"ͷه࿥Λߋ৽த
  51. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ᷿Ͱᷚ͞Ε͍ͯΔྑ͍࿩͠ ෭࡞༻͕͘͢ͳ͍ʂ σʔλॲཧʹूதʂ HPUP͸ॲཧϑϩʔͷ໎ࢠ 00͸ঢ়ଶͷ໎ࢠ ߨٛϊʔτ

    ɹHPUPͱ00ͷ࿩͠͸ ϓϩάϥϛϯά&MJYJSͰ঺հ͞Ε͍ͯΔ ʮͲͷΑ͏ͳܦҢͰ ͜ͷεςʔλεʹḷΓண͍ͨͷ͔ ʯ͕ղΓ೉ ͍ͱ͍͏࿩͠ॻ͖ํͷ໰୊Ͱ͸͋Δ
  52. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ᷿Ͱᷚ͞Ε͍ͯΔྑ͍࿩͠ ෭࡞༻͕͘͢ͳ͍ʂ σʔλॲཧʹूதʂ HPUP͸ॲཧϑϩʔͷ໎ࢠ 00͸ঢ়ଶͷ໎ࢠ ֓೦ࣗମͷֶशʹ

    ίετ͕ඞཁ ෑډ͕ߴ͗͢Δ ͔͠΋Կ͕خ͍͔͠ෆ໌ ᷿Ͱᷚ͞Ε͍ͯΔѱ͍࿩͠ ߨٛϊʔτ ɹؔ਺ܕͷશͯͷಛੑ͕೉͍͠Θ͚Ͱ͸ͳ͍ ɹ͔͠͠ ੈؒతʹ͸೉͍͠ͱೝࣝ͞Ε͍ͯΔ͸ͣʜ
  53. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ લఏ৚͕݅ޡΓ ϚΫϩʁޙ΄Ͳ࿩͠·͢ʜ ؔ਺ܕ༝དྷͷ࢓૊Έ͕গͳ͍ 00༝དྷͷ࢓૊Έ͕গͳ͍ ෳࡶ͕͞ഉআ͞Ε͍ͯͯ 

    ཧղ͢ΔͨΊͷจ຺͕গͳ͍ &MJYJS͸७ਮͳؔ਺ܕͰ͸ͳ͍͔Βʜ ߨٛϊʔτ ɹϚΫϩࣗମ΍ϚΫϩ༝དྷͷ࢓૊Έ͸ ෳࡶ͞Λট͖΍͍͢
  54. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ؔ਺ܕݴޠ͝ͱʹ७ਮ͕͞ҧ͏ ؔ਺ܕ༝དྷͷ࢓૊Έ͕গͳ͍ ݴޠࣗମ͕७ਮͩʂͱݴΘΕΔ৚݅ ࢀরಁաͳؔ਺ͰදݱͰ͖Δ͜ͱ͕ଟ͍ &MJYJS ͋·Γ

    ७ਮͰ͸ͳ͍ FHԋࢉࢠ ྫ֎ *0ͳͲ͕ؔ਺Ͱදݱ͞Ε͍ͯΔ ߨٛϊʔτ ɹ͋·Γ७ਮͰ͸ͳ͍΋͘͠͸ ७ਮͰ͸ͳ͍Α͏ʹݟ͔͚͍ͤͯ Δ७ਮͰ͋Δ͜ͱͷԸܙ͸ଟ͋͘Δ͕ ͜͜Ͱݴ͍͍ͨͷ͸ ؔ਺ ܕݴޠʹ׳Ε͍ͯͳ͍ํʑʹରͯ͠ &MJYJS͸೉͘͠ͳ͍ͱ͍͏࿩
  55. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &MJYJS͋·Γ७ਮͰ͸ͳ͍ for n <- 1..3 do

    if n == 2 do end end ܁Γฦ͠ ৚݅෼ذ ΋͘͠͸ ݟ͔͚͍ͤͯΔʜ
  56. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &MJYJS͋·Γ७ਮͰ͸ͳ͍ try do for n <-

    1..3 do if n == 2 do throw :break end end catch :break -> :ok end ܁Γฦ͠ ৚݅෼ذ ྫ֎ ΋͘͠͸ ݟ͔͚͍ͤͯΔʜ
  57. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &MJYJS͋·Γ७ਮͰ͸ͳ͍ try do for n <-

    1..3 do if n == 2 do throw :break end IO.puts "number is #{n}” end catch :break -> :ok end ܁Γฦ͠ ৚݅෼ذ ྫ֎ ೖग़ྗ ΋͘͠͸ ݟ͔͚͍ͤͯΔʜ
  58. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &MJYJS͋·Γ७ਮͰ͸ͳ͍ try do for n <-

    1..3 do if n == 2 do throw :break end IO.puts "number is #{n}” end catch :break -> :ok end ܁Γฦ͠ ৚݅෼ذ ྫ֎ ೖग़ྗ ˞ඇਪ঑ͳॻ͖ํ ΋͘͠͸ ݟ͔͚͍ͤͯΔʜ
  59. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &MJYJS͋·Γ७ਮͰ͸ͳ͍ try do for n <-

    1..3 do if n == 2 do throw :break end IO.puts "number is #{n}” end catch :break -> :ok end ܁Γฦ͠ ৚݅෼ذ ྫ֎ ೖग़ྗ ˞ඇਪ঑ͳॻ͖ํ ΋͘͠͸ ݟ͔͚͍ͤͯΔʜ ߨٛϊʔτ ɹ܁Γฦ͠ ৚݅෼ذ ྫ֎ॲཧͳͲΛ༻͍ͯίʔυ͕هड़Ͱ͖Δ ɹͨͩ͠ ͜ΕΒΛෳࡶʹ૊Έ߹ΘͤΔͷͰ͸ ैདྷͷଞͷݴޠͱ Կ΋มΘΒͳ͍&MJYJSͷֶशΛਐΊΔʹै͍ ΑΓ෼͔Γ΍͘͢  ؆ܿʹίʔυΛهड़Ͱ͖ΔΑ͏ʹͳΔ
  60. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ

    ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠ ߨٛϊʔτ ɹ͜ͷຊ͸ʮ&MYJSΒ͠͞ʯΛֶͿͷʹ࠷ద ɹബ͍ຊʹ&MJYJSͷࢥ૝͕ೱॖ͞Ε͍ͯΔͨΊ ඞಡ ɹશͯΛಡΉඞཁ͸ͳ͘ ͜ͷεϥΠυΛิ଍ࢿྉͱͯ͠  ϖʔδΛಡΉ͜ͱ͔Β࢝ΊΔ
  61. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 IUUQTEFWUPHVNJFMJYJS ϓϩηε

    ϓϩτίϧ ϏϔΠϏΞ ΛಡΈඈ͹͢ ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠
  62. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 IUUQTEFWUPHVNJFMJYJS ϓϩηε

    ϓϩτίϧ ϏϔΠϏΞ ΛಡΈඈ͹͢ ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠ ߨٛϊʔτ ɹ&MJYJSެࣜαΠτͷHFUUJOHTUBSUFEͷ๜༁ ɹ  ͸্ڃऀ޲͚ͷ಺༰Ͱ͋ΔͨΊ ಡΈඈ͹ͯ͠Α͍
  63. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 IUUQTEFWUPHVNJFMJYJS ϓϩηε

    ϓϩτίϧ ϏϔΠϏΞ ΛಡΈඈ͹͢ IUUQTFMJYJSTDIPPMDPNKB جૅͷষ͚ͩಡΉ ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠
  64. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 IUUQTEFWUPHVNJFMJYJS ϓϩηε

    ϓϩτίϧ ϏϔΠϏΞ ΛಡΈඈ͹͢ IUUQTFMJYJSTDIPPMDPNKB جૅͷষ͚ͩಡΉ ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠ ߨٛϊʔτ ɹ&MJYJS4DIPPMͷ๜༁ ɹجૅͷষ͔Β࢝ΊΔ ɹ&MJYJSެࣜαΠτͷHFUUJOHTUBSUFEΑΓ આ໌ॱʹηϯεΛײ ͡Δ
  65. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 IUUQTEFWUPHVNJFMJYJS ϓϩηε

    ϓϩτίϧ ϏϔΠϏΞ ΛಡΈඈ͹͢ IUUQTFMJYJSTDIPPMDPNKB جૅͷষ͚ͩಡΉ IUUQTIFYEPDTQNQIPFOJYPWFSWJFXIUNM 6QBOE3VOOJOH͔Β࢝ΊΔ ͸͡Ί͸ $IBOOFMT 1SFTFODFΛಡΈඈ͹͢ ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠
  66. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 IUUQTEFWUPHVNJFMJYJS ϓϩηε

    ϓϩτίϧ ϏϔΠϏΞ ΛಡΈඈ͹͢ IUUQTFMJYJSTDIPPMDPNKB جૅͷষ͚ͩಡΉ IUUQTIFYEPDTQNQIPFOJYPWFSWJFXIUNM 6QBOE3VOOJOH͔Β࢝ΊΔ ͸͡Ί͸ $IBOOFMT 1SFTFODFΛಡΈඈ͹͢ ͜ΕҎ߱ͷεϥΠυΛิ଍ࢿྉʹͯ͠ ϓϩάϥϛϯά&MJYJSQΛಡΉ ຊ౰͸ରԠͷݪॻΛಡΜͰ΄͍͠ ߨٛϊʔτ ɹ͜Ε͚ͩ๜༁͸ଘࡏ͠ͳ͍ ɹҰൠతͳ8FCαʔϏεͷ։ൃͰ͋Ε͹ $IBOOFMT΍ 1SFTFODFͷ߲ΛಡΈඈ͹ͯ͠Α͍
  67. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS ΛಡΉલʹʜ Ϧετ &OVN ύΠϓϥΠϯ EP

    ߨٛϊʔτ ʮϓϩάϥϛϯάͱ͸σʔλΛม׵͢Δ͜ͱʯͱ͍͏࿩͕͠ ϓϩ άϥϛϯά&MJYJSͰ঺հ͞Ε͍ͯΔ͕ Ϧετ &OVNϞδϡʔϧ  ύΠϓϥΠϯԋࢉࢠ͸ ·͞ʹσʔλม׵ͷಓ۩࢝Ίʹ ͜͜ʹֶ शίετΛࢧ෷͏
  68. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &OVNͱGPSʹӅΕ͍ͯΔ͕ʜ Ϧετ ਖ਼͘͠ཧղͯ͠׆༻͢ΔͨΊʹ ׆༻ͷ伴 ߏ଄ͱ ࠶ؼ

    ˞Մಡੑ&OVNͱGPS࠶ؼ ߨٛϊʔτ ɹ࠶ؼΛ࢖͍͜ͳ͢ͱ දݱͷࣗ༝౓͕޿͕Δ͕ Մಡੑ͕མͪΔ ɹGPS΍&OVNͰཁ݅ΛຬͨͤΔ৔߹ ͦͪΒΛ࢖͏͜ͱ
  69. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ [1 | 2]  

    ϖΞͱ͍͏ߏ଄͕͋Δ ߨٛϊʔτ ɹϖΞߏ଄ͷӈͱࠨ͸ ͲͷΑ͏ͳܕΛೖΕͯ΋ڐ͞ΕΔ ɹ͜ͷྫͷϖΞ͸ ਺஋ͱ਺஋ͷϖΞ
  70. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ [1 | 2]  

    [1] = [1 | []]  ϖΞͱ͍͏ߏ଄͕͋Δ Ϧετͱ͸ϖΞͰ࡞ͬͨ ϦϯΫϦετ
  71. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ [1 | 2]  

    [1] = [1 | []]  ϖΞͱ͍͏ߏ଄͕͋Δ Ϧετͱ͸ϖΞͰ࡞ͬͨ ϦϯΫϦετ ߨٛϊʔτ ɹ<>ͱ͍͏දݱ͸ <c<>>ͷ౶ҥߏจ ɹ<>͸ ਺஋ͱۭϦετͷϖΞ
  72. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ [1 | 2]  

    [1] = [1 | []]  ϖΞͱ͍͏ߏ଄͕͋Δ Ϧετͱ͸ϖΞͰ࡞ͬͨ ϦϯΫϦετ [1, 2, 3]
  73. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ   [1, 2, 3]

    = [1 | [2 | [3 | []]]] [1 | 2]   [1] = [1 | []]   ϖΞͱ͍͏ߏ଄͕͋Δ Ϧετͱ͸ϖΞͰ࡞ͬͨ ϦϯΫϦετ
  74. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ  t1 = [1 |

    [2 | []]]  U t2 = [0 | t1]   U  ઌ಄ʹཁૉΛ௥Ճ ͱͯ΋ૣ͍
  75. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ defmodule Test do def puts([])

    do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3])
  76. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ defmodule Test do def puts([])

    do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3])
  77. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ defmodule Test do def puts([])

    do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3])    Ұप໨ O UBJM
  78. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ defmodule Test do def puts([])

    do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3])    Ұप໨ O UBJM   ೋप໨ O UBJM
  79. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ  ࡾप໨ O UBJM defmodule

    Test do def puts([]) do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3])
  80. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ  ࡾप໨ O UBJM ࢛प໨

    <> defmodule Test do def puts([]) do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3])
  81. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ Ϧετ  ࡾप໨ O UBJM ࢛प໨

    <> defmodule Test do def puts([]) do IO.puts("finish") end def puts([n | tail]) do IO.puts("number is #{n}") puts(tail) end end Test.puts([1, 2, 3]) ߨٛϊʔτ ɹ͜ͷ࠶ؼͷྫΛ ͜ͷઆ໌͚ͩͰཧղͰ͖ͳ͘ͱ΋Α͍ ɹ͜ͷิ଍આ໌Λ΋ͱʹ ϓϩάϥϛϯά&MJYJSͷϦετͱ࠶ؼͷ ߲ΛಡΉͱ ཧղ͠΍͍͢ ɹϓϩάϥϛϯά&MJYJSͱ͜ͷઆ໌Λ ͍ͬͨΓ͖ͨΓͰཧղ͢Δ
  82. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ _.filter(list, (elem) => {}) .map((elem) =>

    {}) .sortBy((elem) => {}); list |> Enum.filter(fn (elem) -> end) |> Enum.map(fn (elem) -> end) |> Enum.sort(fn (elem) -> end) &MJYJSͩͱʜ &OVN
  83. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ _.filter(list, (elem) => {}) .map((elem) =>

    {}) .sortBy((elem) => {}); list |> Enum.filter(fn (elem) -> end) |> Enum.map(fn (elem) -> end) |> Enum.sort(fn (elem) -> end) &MJYJSͩͱʜ &OVN ߨٛϊʔτ ɹಉ͡Α͏ͳ໊લͱػೳͷྫ ɹ+BWB4DSJQUͰ΋&MJYJSͰ΋ಉ͡Α͏ʹهड़Ͱ͖Δ
  84. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ % wc -l */**.ex | tail

    -1 39053 total % ag Enum | awk 'match($0, /Enum\.[a-z_\?]+/) {print substr($0, RSTART, RLENGTH)}' \ | sort | uniq -c | sort -nr | head -20 237 Enum.map 96 Enum.filter 37 Enum.into 30 Enum.group_by 24 Enum.reduce 22 Enum.empty? 18 Enum.sort 15 Enum.sum 12 Enum.reject 11 Enum.at 6 Enum.uniq 6 Enum.take 6 Enum.map_reduce 6 Enum.join 6 Enum.count 5 Enum.sort_by 5 Enum.reverse 4 Enum.random 4 Enum.flat_map 4 Enum.find
  85. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ % wc -l */**.ex | tail

    -1 39053 total % ag Enum | awk 'match($0, /Enum\.[a-z_\?]+/) {print substr($0, RSTART, RLENGTH)}' \ | sort | uniq -c | sort -nr | head -20 237 Enum.map 96 Enum.filter 37 Enum.into 30 Enum.group_by 24 Enum.reduce 22 Enum.empty? 18 Enum.sort 15 Enum.sum 12 Enum.reject 11 Enum.at 6 Enum.uniq 6 Enum.take 6 Enum.map_reduce 6 Enum.join 6 Enum.count 5 Enum.sort_by 5 Enum.reverse 4 Enum.random 4 Enum.flat_map 4 Enum.find ߨٛϊʔτ ɹωλ ɹ࣮ϓϩδΣΫτͰ࢖༻ճ਺Λूܭͯ͠Έͨ ɹNBQͷ࢖༻ճ਺͕μϯτπͰଟ͍
  86. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &OVN Α͘࢖͏΋ͷ͔Β֮͑Δ FHϓϩάϥϛϯά&MJYJS &MJYJS4DIPPM Ͱ঺հ͞Ε͍ͯΔؔ਺ͳͲ αϑΟοΫεΛ֮͑Δ

    @CZ @XIJMF @FWFSZ ߨٛϊʔτ ɹ&OVNΑΓGPSͷՄಡੑ͕ߴ͍͜ͱ͕͋ΔpMUFS@NBQͱ͍͏ ؔ਺͕&OVN͔Β࡟আ͞Εͨ͜ͱ͕͋Γ ࡟আཧ༝͸GPSΛ࢖͑ ɹઌ΄Ͳͷ࣮ϓϩδΣΫτͰݕࡧ͢Δͱ GPSͷ࢖༻ճ਺͸ ݅Ͱ NBQͷ࣍ʹ࢖༻ճ਺͕ଟ͍݁Ռͱͳͬͨ
  87. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |> GumiInc.elixirͷܦݧΛ௥Ճ͢Δ

    ߨٛϊʔτ ɹωλ ɹ͋͟ͱ͍ྫͰਃ͠༁ͳ͍&MJYJS'FTU͸ ೥݄೔ ɹม਺໊ͱؔ਺໊͸ ϚϧνόΠτจࣈΛ࢖༻Ͱ͖Δ ɹϞδϡʔϧ໊͸ ϚϧνόΠτจࣈΛ࢖༻Ͱ͖ͳ͍
  88. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |> GumiInc.elixirͷܦݧΛ௥Ճ͢Δ

    ύΠϓϥΠϯͷଘࡏҙٛՄಡੑͷ্ঢ GumiInc.elixirͷܦݧΛ௥Ճ͢Δ( ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ(زా) )
  89. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |> GumiInc.elixirͷܦݧΛ௥Ճ͢Δ

    ύΠϓϥΠϯͷଘࡏҙٛՄಡੑͷ্ঢ GumiInc.elixirͷܦݧΛ௥Ճ͢Δ( ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ(زా) )
  90. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ ύΠϓϥΠϯͷଘࡏҙٛ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |>

    GumiInc.elixirͷܦݧΛ௥Ճ͢Δ ؔ਺ఆٛʹҰ؏ੑ͕ੜ͡Δ ύΠϓϥΠϯ͕࢖͑ΔΑ͏ʹؔ਺Λఆٛ͢Δบ ୈҰҾ਺ૢ࡞લσʔλ ɹ໭Γ஋ૢ࡞ޙσʔλ
  91. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ ύΠϓϥΠϯͷଘࡏҙٛ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |>

    GumiInc.elixirͷܦݧΛ௥Ճ͢Δ ศརྑ͍श׳ ؔ਺ఆٛʹҰ؏ੑ͕ੜ͡Δ ύΠϓϥΠϯ͕࢖͑ΔΑ͏ʹؔ਺Λఆٛ͢Δบ ୈҰҾ਺ૢ࡞લσʔλ ɹ໭Γ஋ૢ࡞ޙσʔλ
  92. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ ύΠϓϥΠϯͷଘࡏҙٛ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |>

    GumiInc.elixirͷܦݧΛ௥Ճ͢Δ ศརྑ͍श׳ ؔ਺ఆٛʹҰ؏ੑ͕ੜ͡Δ ύΠϓϥΠϯ͕࢖͑ΔΑ͏ʹؔ਺Λఆٛ͢Δบ ୈҰҾ਺ૢ࡞લσʔλ ɹ໭Γ஋ૢ࡞ޙσʔλ ߨٛϊʔτ ɹҰ؏ੑ͕͋Δ͔Β ࢓༷͕༧ଌ͠΍͍͢ ɹศརͱྑ͍श׳ͷྑ॥؀
  93. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ύΠϓϥΠϯ ύΠϓϥΠϯͷଘࡏҙٛ زా |> ElixirFest2019.elixirͷ஌ࣝΛ௥Ճ͢Δ |>

    GumiInc.elixirͷܦݧΛ௥Ճ͢Δ ศརྑ͍श׳ ؔ਺ఆٛʹҰ؏ੑ͕ੜ͡Δ ύΠϓϥΠϯ͕࢖͑ΔΑ͏ʹؔ਺Λఆٛ͢Δบ ୈҰҾ਺ૢ࡞લσʔλ ɹ໭Γ஋ૢ࡞ޙσʔλ ߨٛϊʔτ ωλ ɹ1ZUIPOͷTPSUFE͸ୈҰҾ਺͕*UFSBCMFͰ NBQ͸ୈೋҾ਺ ͕*UFSBCMFࢲ͸ TPSUFEͷҾ਺ΛΑؒ͘ҧ͑Δ ɹTPSUFEʹ౉ؔ͢਺͸ LFZΛฦ͔͢Βͩͱࢥ͏͕ʜਏ͍
  94. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ defmodule Test do def test do

    a = 1 b = if :true do a = 2 a end {a, b} end end {1, 2} = Test.test EP
  95. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ defmodule Test do def test do

    a = 1 b = if :true do a = 2 a end {a, b} end end {1, 2} = Test.test EP EFGͷείʔϓ಺
  96. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ defmodule Test do def test do

    a = 1 b = if :true do a = 2 a end {a, b} end end {1, 2} = Test.test EP JGͷ໭Γ஋ EFGͷείʔϓ಺
  97. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ defmodule Test do def test do

    a = 1 b = if :true do a = 2 a end {a, b} end end {1, 2} = Test.test EP JGͷείʔϓ಺ JGͷ໭Γ஋ EFGͷείʔϓ಺
  98. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ defmodule Test do def test do

    a = 1 b = if :true do a = 2 a end {a, b} end end {1, 2} = Test.test EP JGͷ໭Γ஋ JGͷείʔϓ಺ B C EFGͷείʔϓ಺
  99. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ defmodule Test do def test do

    a = 1 b = if :true do a = 2 a end {a, b} end end {1, 2} = Test.test EP JGͷείʔϓ಺ B C ߨٛϊʔτ ɹϒϩοΫʹείʔϓͱ໭Γ஋͕͋ΔͨΊ ϒϩοΫωετͷਂ͍ͱ ͜ΖͰ ্ҐϒϩοΫͷม਺Λ࠶ଋറ ͢Δඞཁ͕ͳ͍cͰ͖ͳ͍  ɹΑͬͯʮ͜ͷ஋͸ Ͳ͔͜Βདྷͨͷ͔ʁʯΛௐ΂Δख͕ؒݮΓ Մ ಡੑ্͕͕Δ JGͷ໭Γ஋ EFGͷείʔϓ಺
  100. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ ϓϩάϥϛϯά&MJYJS ΛಡΉલʹʜ Ϧετ &OVN ύΠϓϥΠϯ EP

    ߨٛϊʔτ ɹϓϩάϥϛϯά&MJYJSΛಡΉલ ΋͘͠͸ಡΜͩޙʹ ิ଍ࢿྉͱ ͯ͠ ͜ͷεϥΠυͷϦετ &OVN ύΠϓϥΠϯ EPͷઆ໌Λಡ Έฦ͢ͱ ཧղ͕ਂ·Δ
  101. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕ &MJYJS͋·Γ७ਮͰ͸ͳ͍ Ͱ΋ &MJYJSΒ͕͠͞ᕷΈग़ͨίʔυͷಡΈॻ͖ʹ͸  ֶशίετ͕ඞཁͰ͠ΐ͏ ଟ෼

    ͦΜͳʹେมͰ͸ͳ͍ʜ ͓͢͢Ίͷ ֶशํ๏ ϓϩάϥϛϯά&MJYJS &MJYJSೖ໳ &MJYJS4DIPPM 1IPFOJY(6*%&4 ߨٛϊʔτ ɹؔ਺ܕͱ͍ͬͯ΋ ͦΕ΄Ͳ&MJYJS͸೉͘͠ͳ͍ ɹͥͻ ؾܰʹೖ໳ͯ͠΄͍͠
  102. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ฒߦॲཧ ֶशίετΛׂ͘ Ϧετͷѻ͍ํ ͠͹Β͘ ֶशίετΛׂ͔ͳ͍ ฒߦॲཧશൠ ϚΫϩશൠ

    ϏϔΠϏΞͱϓϩτίϧ ֶͿ͜ͱΛऔࣺબ୒ֶͯ͠शίετΛԼ͛Δ ߨٛϊʔτ ɹϚΫϩ ϏϔΠϏΞ ϓϩτίϧ͸ ֶशΛޙճ͠ʹͯ͠ྑ͍ཧ༝ ͸ ࣌ؒͷ౎߹Ͱઆ໌͍ͯ͠ͳ͍ख୹ʹઆ໌͢Δͱ 8FCγεςϜ ͷ։ൃʹݶఆ͢Δͱ ৽ͨʹ ࣗ࡞ͷ͜ΕΒΛఆٛ͠ͳ͘ͱ΋ ։ൃ Ͱ͖Δ͔Β
  103. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ·ͱΊ ֶशίετ͕ߴ͍ &MJYJS͸ֶशίετͷׂʹ͸ Ըܙ͕େ͖͍ ࣋ͪؼͬͯ΄͍͜͠ͱ ҆શੑ͕ߴ͘ ੜ࢈ੑ͕ߴ͘

    ͦΕҎ֎ͷੑ࣭͸ ΄Ͳྑ͍ ࠓ೔࿩ͨ͜͠ͱ ͸ߴ͘΋௿͘΋ͳ͍ 8FCγεςϜͷ։ൃͳΒ͹ Ճ͑ͯʜ ྑ͍͜ͱ΋ѱ͍͜ͱ΋࿩͢
  104. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࢲ͕Ѫ͢Δ Elixir/Erlang ͷָ͠͞ͱਏ͞ Developers Summit 2019 15-D-5

    ͜ΕΛ·ͩ஌Βͳ͍8FCΤϯδχΞ΁ଃΔ ೥݄೔ HVNJ*OD$50زాխਔ
  105. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ࢲ͕Ѫ͢Δ Elixir/Erlang ͷ ਏ͞ Developers Summit 2019

    15-D-5 (ཪ) ͜ΕΛ·ͩ஌Βͳ͍8FCΤϯδχΞ΁ଃΔ ೥݄೔ HVNJ*OD$50زాխਔ
  106. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 051͸ߴػೳ ίʔυͷϗοτεϫοϓʂ ΫϥελϦϯά ෼ࢄ%#׬උ ΦϯϝϞϦʔϞʔυͳΒ45. &SMBOH5FSNͰͳΜͰ΋γϦΞϥΠζ

    ͦͯ͠ωοτϫʔΫӽ͠ʹసૹʂ ؔ਺ͩͬͯૹΕͪΌ͏ 051051 ઌਓͷ஌ܙͷू໿ HSPVQMFBEFSೖΕସ͑ͯ ଞϊʔυʹϩάग़ྗ
  107. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 051͸ߴػೳ ίʔυͷϗοτεϫοϓʂ ΫϥελϦϯά ෼ࢄ%#׬උ ΦϯϝϞϦʔϞʔυͳΒ45. &SMBOH5FSNͰͳΜͰ΋γϦΞϥΠζ

    ͦͯ͠ωοτϫʔΫӽ͠ʹసૹʂ ؔ਺ͩͬͯૹΕͪΌ͏ 051051 ઌਓͷ஌ܙͷू໿ HSPVQMFBEFSೖΕସ͑ͯ ଞϊʔυʹϩάग़ྗ ߨٛϊʔτ ɹ͜ΕͰ΋ණࢁͷҰ֯
  108. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 051͸ߴػೳ ίʔυͷϗοτεϫοϓʂ ΫϥελϦϯά ෼ࢄ%#׬උ ΦϯϝϞϦʔϞʔυͳΒ45. &SMBOH5FSNͰͳΜͰ΋γϦΞϥΠζ

    ͦͯ͠ωοτϫʔΫӽ͠ʹసૹʂ ؔ਺ͩͬͯૹΕͪΌ͏ 051051 ઌਓͷ஌ܙͷू໿ ͋Δͱ࢖͍ͨ͘ͳΓ·͢ΑͶʁ HSPVQMFBEFSೖΕସ͑ͯ ଞϊʔυʹϩάग़ྗ
  109. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 051͸ߴػೳ ίʔυͷϗοτεϫοϓʂ ΫϥελϦϯά ෼ࢄ%#׬උ ΦϯϝϞϦʔϞʔυͳΒ45. &SMBOH5FSNͰͳΜͰ΋γϦΞϥΠζ

    ͦͯ͠ωοτϫʔΫӽ͠ʹసૹʂ ؔ਺ͩͬͯૹΕͪΌ͏ 051051 ઌਓͷ஌ܙͷू໿ ͋Δͱ࢖͍ͨ͘ͳΓ·͢ΑͶʁ HSPVQMFBEFSೖΕସ͑ͯ ଞϊʔυʹϩάग़ྗ 8FCγεςϜ։ൃͰ͸  ΄΅ ඞཁͳ͍
  110. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 8FCγεςϜ։ൃͰ͸  ΄΅ඞཁͳ͍ 051͸ߴػೳ "1*αʔόΛ&MJYJSͰॻ͘ ཧ༝͸

    ͖ͬ͞࿩ͨ͠  "1*αʔό͸εςʔτϨεʹͯ͠ΦʔτεέʔϦϯάʹରԠ͢Δ Ωϟογϡ΍%#ͳͲ͸ ط੡඼Λ࢖͏ &MJYJSͷ༻్ΛׂΓ੾Δ
  111. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 8FCγεςϜ։ൃͰ͸  ΄΅ඞཁͳ͍ 051͸ߴػೳ "1*αʔόΛ&MJYJSͰॻ͘ ཧ༝͸

    ͖ͬ͞࿩ͨ͠  "1*αʔό͸εςʔτϨεʹͯ͠ΦʔτεέʔϦϯάʹରԠ͢Δ Ωϟογϡ΍%#ͳͲ͸ ط੡඼Λ࢖͏ &MJYJSͷ༻్ΛׂΓ੾Δ ࢲͷϞνϕʔγϣϯ ָΛ͍ͨ͠
  112. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 8FCγεςϜ։ൃͰ͸  ΄΅ඞཁͳ͍ 051͸ߴػೳ "1*αʔόΛ&MJYJSͰॻ͘ ཧ༝͸

    ͖ͬ͞࿩ͨ͠  "1*αʔό͸εςʔτϨεʹͯ͠ΦʔτεέʔϦϯάʹରԠ͢Δ Ωϟογϡ΍%#ͳͲ͸ ط੡඼Λ࢖͏ &MJYJSͷ༻్ΛׂΓ੾Δ ࢲͷϞνϕʔγϣϯ ָΛ͍ͨ͠ ߨٛϊʔτ ɹ"1*αʔόͷ։ൃͱӡ༻ͰָΛ͍ͨ͠ͷ͸ ϏδωεͳͲʹूத ͍͔ͨ͠Β
  113. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 &54 %&54 .OFTJB ͍͢͝&SMBOHΏ͔͍ʹֶ΅͏ ͜ΕΒͷྑ͞΍࢖͍ํ͸ʜ Λ֬͝ೝ͍ͩ͘͞

    ߨٛϊʔτ ɹ&54͸ ΦϯϝϞϦ%# %&54͸ ΦϯσΟεΫ%# .OFTJB ͸ &54ͱ%&54ͷ্ʹߏங͞Εͨ෼ࢄ%#
  114. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 &54 %&54 .OFTJB ͍͢͝&SMBOHΏ͔͍ʹֶ΅͏ ͜ΕΒͷྑ͞΍࢖͍ํ͸ʜ Λ֬͝ೝ͍ͩ͘͞

    εςʔλεΛڞ༗͢Δखஈ ߨٛϊʔτ ɹ&54͸ Ωϟογϡ༻్ʹศར͕ͩ ڞ༗ϝϞϦͰεϨουϓϩ άϥϛϯά͢Δੈքʹٯ໭Γ͢Δ ɹ.OFTJB͸ "1*αʔόʹ%#ͷϩʔϧΛ୲ΘͤΔͨΊ αʔό ͷΦʔτεέʔϦϯάͷ೉қ౓Λ্͛Δ
  115. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 &54 %&54 .OFTJB ͍͢͝&SMBOHΏ͔͍ʹֶ΅͏ ͜ΕΒͷྑ͞΍࢖͍ํ͸ʜ Λ֬͝ೝ͍ͩ͘͞

    εςʔλεΛڞ༗͢Δखஈ ߨٛϊʔτ ɹ"1*αʔόΛ࡞Δ͚ͩͳΒ ແବͳෳࡶੑΛγεςϜʹݺͼࠐ· ͳ͍Α͏ ར༻͸ආ͚Δ͜ͱ
  116. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 &54 %&54 .OFTJB ͍͢͝&SMBOHΏ͔͍ʹֶ΅͏ ͜ΕΒͷྑ͞΍࢖͍ํ͸ʜ Λ֬͝ೝ͍ͩ͘͞

    εςʔλεΛڞ༗͢Δखஈ ߨٛϊʔτ ɹ&54͸ &DUP಺Ͱ1SFQBSFͨ͠%#2VFSZΛҰϊʔυ಺Ͱ Ωϟογϡͯ͠࢖͍ճ͢ͳͲʹར༻͞Ε͍ͯΔ ɹ&MJYJSೖ໳௚ޙ͸ ͜ͷΑ͏ͳνϡʔχϯάΛ࣮੷͋ΔϥΠϒϥϦ ʹ೚ͤΔ͜ͱ
  117. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ΫϥελϦϯά &54 %&54 .OFTJB ίʔυϗοτεϫοϓ ͜ͷลΓΛஅࣺ཭ͯ͠Α͍

    &MJYJSͷ༻్ΛׂΓ੾Δ ΋ͬͱ͋Δ͔΋ʜ ߨٛϊʔτ ɹΫϥελϦϯάͷ࿩͠͸লུ͢Δ ɹΦʔτεέʔϦϯάͷ೉қ౓্͕͕ΔͨΊ આ໌͢Δ·Ͱ΋ͳ͍
  118. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    ߨٛϊʔτ ɹؔ਺Λ࠶ؼ͢Δࡍ Ϟδϡʔϧ໊ΛؚΉϑϧωʔϜͰධՁ͢Δͱ  ίʔυϗοτεϫοϓͱͳΔ ɹҰݟ͢Δͱ ඇৗʹ୯७ͳ࢓૊Έ
  119. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    IUUQTIBQQJHJUIVCJPUIF#FBN#PPL ϓϩηεΛӽڥͯ͠ίʔυϗοτεϫοϓ͕ γεςϜશମʹద༻͞Ε͍ͯΔࣄྫ͸ Έͨ͜ͱͳ͍
  120. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    IUUQTIBQQJHJUIVCJPUIF#FBN#PPL ϓϩηεΛӽڥͯ͠ίʔυϗοτεϫοϓ͕ γεςϜશମʹద༻͞Ε͍ͯΔࣄྫ͸ Έͨ͜ͱͳ͍ ߨٛϊʔτ ɹUIF#&".#PPLͰ͢Β ͜Μͳ͜ͱ͕هड़͞Ε͍ͯΔ ɹ͔͠΋ ίʔυϗοτεϫοϓ͕ଘࡏ͢Δ͔Β &SMBOH͸੩తܕ ෇͚ʹͰ͖ͳ͍ͱ͍͏୰͖΋ఴ͑ΒΕ͍ͯΔ
  121. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    IUUQTIBQQJHJUIVCJPUIF#FBN#PPL ϓϩηεΛӽڥͯ͠ίʔυϗοτεϫοϓ͕ γεςϜશମʹద༻͞Ε͍ͯΔࣄྫ͸ Έͨ͜ͱͳ͍ ߨٛϊʔτ ɹىಈ͍ͯ͠Δϓϩηεશͯʹରͯ͠ ׬ᘳʹίʔυϗοτεϫοϓ ʹରԠ͍ͯ͠Δͱอূ͢ΔίετΑΓ ࠶ىಈίετͷํ͕௿͍ ɹαʔϏεͷແఀࢭΛ࣮ݱ͢ΔͳΒ͹ #MVF(SFFO%FQMPZͰΑ ͍
  122. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    IUUQTIBQQJHJUIVCJPUIF#FBN#PPL ϓϩηεΛӽڥͯ͠ίʔυϗοτεϫοϓ͕ γεςϜશମʹద༻͞Ε͍ͯΔࣄྫ͸ Έͨ͜ͱͳ͍ ߨٛϊʔτ ɹEJTUJMMFSZͷVQHSBEF͕ػೳ͢Δύλʔϯ΋͋Δ ɹ͔͠͠ ͋ΔύλʔϯͰ͸ػೳ͢Δ͔Β࢖͏ ͋ΔύλʔϯͰ͸ػ ೳ͠ͳ͍͔Β࠶ىಈ͢Δʜͱ͍͏෼ذ͕ଘࡏ͢Δͱ ӡ༻ίετ͕ ্͕Δ
  123. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    IUUQTIBQQJHJUIVCJPUIF#FBN#PPL ϓϩηεΛӽڥͯ͠ίʔυϗοτεϫοϓ͕ γεςϜશମʹద༻͞Ε͍ͯΔࣄྫ͸ Έͨ͜ͱͳ͍ ߨٛϊʔτ ɹྫ͑͹ "1*αʔόͰ పఈతʹࣗ࡞ϓϩηεͷ࢖༻Λආ͚ͨͱ͠ ͯ΋ ґଘ͍ͯ͠ΔEFQTΛߋ৽͢Δ৔߹ ଞਓͷίʔυ͕ίʔυϗ οτεϫοϓʹରԠ͍ͯ͠Δ͔֬ೝ͢Δඞཁ͕͋ΔରԠ͍ͯ͠ͳ͚ Ε͹ ࠶ىಈͱͳΔຖճ ൑அίετ͕ൃੜ͍ͯ͠Δ
  124. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 ίʔυϗοτεϫοϓ ϓϩηε຤ඌ࠶ؼ͍ͯ͠Δؔ਺ ίʔυϗοτεϫοϓ ຤ඌ࠶ؼ͢Δؔ਺Λ ϑϧωʔϜͰධՁ͢Δͱ ൃੜ͢Δ

    IUUQTIBQQJHJUIVCJPUIF#FBN#PPL ϓϩηεΛӽڥͯ͠ίʔυϗοτεϫοϓ͕ γεςϜશମʹద༻͞Ε͍ͯΔࣄྫ͸ Έͨ͜ͱͳ͍ ߨٛϊʔτ ɹͦ΋ͦ΋ "1*αʔό͸εςʔτϨεʹઃܭ͠ ΦʔτεέʔϦϯ άʹରԠ͢Δํ਑Ͱ͋ΔͳΒ͹ ίʔυϗοτεϫοϓՄೳͳঢ়ଶΛ ҡ࣋͢ΔίετΛࢧ෷͏ҙຯ͕ͳ͍
  125. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE 051 8FCγεςϜ։ൃͰ͸  ΄΅ඞཁͳ͍ 051͸ߴػೳ "1*αʔόΛ&MJYJSͰॻ͘ ཧ༝͸

    ͖ͬ͞࿩ͨ͠  "1*αʔό͸εςʔτϨεʹͯ͠ΦʔτεέʔϦϯάʹରԠ͢Δ Ωϟογϡ΍%#ͳͲ͸ ط੡඼Λ࢖͏ &MJYJSͷ༻్ΛׂΓ੾Δ ࢲͷϞνϕʔγϣϯ ָΛ͍ͨ͠
  126. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE It is really common for OO developers

    to think of Elixir modules as the minimal code structure (and therefore breaking everything into modules) and forget about functions. +PTÉ7BMJN (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ؔ਺ܕͱ00 ࠞઢ͢Δؔ਺ܕͱ00
  127. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE Ұൠతʹ OO ͷ։ൃऀͨͪ͸, Elixir ͷϞδϡʔϧΛ࠷খͷ ίʔυߏ଄ͱΈͳͯؔ͠਺Λ๨Εͯ͠·͏. (ͦΕނ,

    શͯΛ ϞδϡʔϧԽ͢Δ) +PTÉ7BMJN ؔ਺ܕͱ00 (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ࠞઢ͢Δؔ਺ܕͱ00
  128. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺Λ·ͱΊΔ ߏ଄ମ΍ܕΛఆٛ͢Δ ࠞઢ͢Δؔ਺ܕͱ00 ؔ਺ܕͱ00 Ϟδϡʔϧͷͭͷ໾ׂ defmodule User

    do defstruct name: nil, age: nil def new(name, age) do %User{name: name, age: age} end def puts_name(%User{name: name}) do IO.puts name end end
  129. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺Λ·ͱΊΔ ߏ଄ମ΍ܕΛఆٛ͢Δ ࠞઢ͢Δؔ਺ܕͱ00 ؔ਺ܕͱ00 Ϟδϡʔϧͷͭͷ໾ׂ defmodule User

    do defstruct name: nil, age: nil def new(name, age) do %User{name: name, age: age} end def puts_name(%User{name: name}) do IO.puts name end end Ϋϥεఆٛ ʹݟ͑Δ
  130. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺Λ·ͱΊΔ ߏ଄ମ΍ܕΛఆٛ͢Δ ࠞઢ͢Δؔ਺ܕͱ00 ؔ਺ܕͱ00 Ϟδϡʔϧͷͭͷ໾ׂ defmodule User

    do defstruct name: nil, age: nil def new(name, age) do %User{name: name, age: age} end def puts_name(%User{name: name}) do IO.puts name end end Ϋϥεఆٛ ʹݟ͑Δ ߨٛϊʔτ ɹΫϥεఆٛʹݟ͑Δͱ Կ͕͍͚ͳ͍ͷ͔ʁ
  131. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕͱ00 (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ࠞઢ͢Δؔ਺ܕͱ00 &DUPΛϦϙδτϦύλʔϯͰந৅Խ͢ΔΞΠσΞ 00͞Μ 6TFS3FQPϞδϡʔϧ HFU@BDUJWFؔ਺Ͱ

    !SFQPHFU@BDUJWFΛ࣮ߦ !SFQP&DUP6TFS3FQP *'୲౰ ςετ࣌ʹ!SFQPΛม͑Δ༧ఆ ߨٛϊʔτ ɹ6TFS3FQP͸ίϯτϩʔϥʔ͔Β࢖༻͞ΕΔ ɹ!SFQP͸ઃఆϑΝΠϧ͔Βऔಘ͢Δॳظ஋͸&DUP6TFS3FQP ͕ͩ ςετ࣌ʹઃఆϑΝΠϧͰೖΕସ͑Δ
  132. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕͱ00 (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ࠞઢ͢Δؔ਺ܕͱ00 &DUPΛϦϙδτϦύλʔϯͰந৅Խ͢ΔΞΠσΞ 00͞Μ 6TFS3FQPϞδϡʔϧ HFU@BDUJWFؔ਺Ͱ

    !SFQPHFU@BDUJWFΛ࣮ߦ !SFQP&DUP6TFS3FQP &DUP6TFS3FQPϞδϡʔϧ HFU@BDUJWFؔ਺Ͱ !SFBE@SFQPHFU@BDUJWFΛ࣮ߦ !SFBE@SFQP.Z"QQ3FQP *'୲౰ ςετ࣌ʹ!SFQPΛม͑Δ༧ఆ &DUP3FQP୲౰ ಡΈࠐΈॻ͖ࠐΈΛ෼͚Δ
  133. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕͱ00 (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ࠞઢ͢Δؔ਺ܕͱ00 &DUPΛϦϙδτϦύλʔϯͰந৅Խ͢ΔΞΠσΞ 00͞Μ 6TFS3FQPϞδϡʔϧ HFU@BDUJWFؔ਺Ͱ

    !SFQPHFU@BDUJWFΛ࣮ߦ !SFQP&DUP6TFS3FQP &DUP6TFS3FQPϞδϡʔϧ HFU@BDUJWFؔ਺Ͱ !SFBE@SFQPHFU@BDUJWFΛ࣮ߦ !SFBE@SFQP.Z"QQ3FQP *'୲౰ ςετ࣌ʹ!SFQPΛม͑Δ༧ఆ &DUP3FQP୲౰ ಡΈࠐΈॻ͖ࠐΈΛ෼͚Δ ߨٛϊʔτ ɹ&DUP6TFS3FQP͸&DUPʹґଘ͢Δ ɹ!SFBE@SFQP͸ઃఆϑΝΠϧ͔Βऔಘ͢Δ ɹεϥΠυʹ͸ؚΊ͍ͯͳ͍͕!XSJUF@SFQP΋͋Δ
  134. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕͱ00 (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ࠞઢ͢Δؔ਺ܕͱ00 &DUPΛϦϙδτϦύλʔϯͰந৅Խ͢ΔΞΠσΞ +PTÉ͞Μ લͷݴޠͰ͸ ͦͷந৅ԽඞཁͩͬͨΜͰ͠ΐʁࠓ͸ඞཁͳ͍Α

    Ͳ͏ͯ͠΋ඞཁͳΒ ςετ࣌ʹ%#࣮૷ͷೖΕସ͑͸ࢭΊͯ  *'ʹͳ͍ͬͯΔؔ਺Λِ૷͠ͳΑ લʹهࣄॻ͍͔ͨΒࢀরͯ͠ IUUQCMPHQMBUBGPSNBUFDDPNCSNPDLTBOEFYQMJDJUDPOUSBDUT
  135. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ؔ਺ܕͱ00 (https://groups.google.com/forum/m/#!topic/elixir-lang-talk/Ib11890jfmY) ࠞઢ͢Δؔ਺ܕͱ00 &DUPΛϦϙδτϦύλʔϯͰந৅Խ͢ΔΞΠσΞ 00͞Μ Θ͔ͬͨΑʜ ΋͏ͪΐͬͱγϯϓϧʹߟ͑௚ͯ͠ΈΔͶ

    ߨٛϊʔτ ɹ&DUP͸෭࡞༻Λ3FQPʹू໿͓ͯ͠Γ ෭࡞༻ͷͳ͍ DIBOHFTFUͱRVFSZʹରͯ͠"TTFSU͢Δํ๏΋બ୒Ͱ͖Δ ɹ͔͠͠ Ұҙ੍໿ͷςετͳͲΛߟྀ͠ ίϯςφΛ༻͍ͯ%#ͳ ͲΛىಈ͠ ςετͨ͠ํ͕Α͍
  136. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE trait HasMessage { // defprotocol, defmodule def

    message():String // @callback def puts(): Unit = println(this.message()) } class A extends HasMessage { // defimpl, defmodule def message() = "I am A.” // @impl } class B extends HasMessage { def message() = "I am B." } object Test { def main(args: Array[String]): Unit = { call_puts(new A) call_puts(new B) } def call_puts(has_message: HasMessage): Unit = has_message.puts() // protocol? behaviour? } ؔ਺ܕͱ00
  137. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE trait HasMessage { // defprotocol, defmodule def

    message():String // @callback def puts(): Unit = println(this.message()) } class A extends HasMessage { // defimpl, defmodule def message() = "I am A.” // @impl } class B extends HasMessage { def message() = "I am B." } object Test { def main(args: Array[String]): Unit = { call_puts(new A) call_puts(new B) } def call_puts(has_message: HasMessage): Unit = has_message.puts() // protocol? behaviour? } ؔ਺ܕͱ00 ߨٛϊʔτ ɹωλ ɹ4DBMBͷ5SBJUͷྫࣔʹ &MJYJSͳΒʁͱ͍͏ίϝϯτೖΕͨ ɹ5SBJUͳͲͷ஌͕ࣝ͋Δͱ ϓϩτίϧ΍ϏϔΠϏΞ͸ ͍ͭ Ͳ ͜Ͱ࢖͏ͷ͔ʁͱ͍͏൑அ͕00ʹඥ෇͍ͯ͠·͏ͷ͕໰୊
  138. $PQZSJHIU $ HVNJ*OD"MM3JHIUT3FTFSWFE ϚΫϩ ϚΫϩ͸ݴޠ࡞ऀָ͕Λ͢Δػೳ ͋·Γʹ΋ڧྗ͗͢Δ ϚΫϩ͸ߴػೳ IUUQTRJJUBDPNDPPMEBFNPOJUFNTDFE IUUQTRJJUBDPNDPPMEBFNPOJUFNTFEBFBB⒎CD ϚΫϩΛॻ͚ͳͯ͘΋ಡΊΔΑ͏ʹͳΖ͏

    ͱ͍͏ࢼΈͷهࣄ ߨٛϊʔτ ɹ&MJYJS͸ ͋ΒΏΔ΋ͷ͕ϚΫϩͰ࣮૷͞Ε͍ͯΔ ɹϚΫϩͷཧղ͸ 8FCγεςϜ։ൃʹ͓͍ͯ͸ඞਢͰ͸ͳ͍͕  ϚΫϩ͕ಡΊͳ͍ͱ ਖ਼͍͠ཧղʹ͕͔͔࣌ؒΔػೳ΋͋ΔͨΊ  &MJYJSʹ׳Ε͔ͯΒ Ώͬ͘Γֶश͢ΔͱΑ͍