Perlの上にも三年 〜 ずっとイケてるサービスを作り続ける技術 〜

Cc696ce673253d3bd21b3aa9e7927f39?s=47 hitode909
August 21, 2015

Perlの上にも三年 〜 ずっとイケてるサービスを作り続ける技術 〜

発表者は,この三年間はてなブログというイケてるPerlのサービスの開発に携ってきました…

Perlの最新を追い求め続けた三年間でした…

なにも分からず,SQLをコピペし続けた数ヶ月…

つらいことも,たのしいことも,みんな分かちあったコードベース…

救いを求め,藁にもすがる思いで,朝も夜も読み続けたオブジェクト指向入門……

偶然発見して,これだと思ったドメイン駆動設計……

苦しみの軌跡と,現在最高の設計を紹介します………!!!!!!!

Cc696ce673253d3bd21b3aa9e7927f39?s=128

hitode909

August 21, 2015
Tweet

Transcript

  1. 1FSMͷ্ʹ΋ࡾ೥ ͣͬͱΠέͯΔαʔϏεΛ ࡞Γଓ͚Δٕज़ IJUPEF

  2. ࢿྉ͖ͬ͞·Ͱ

  3. ຕ

  4. ͕Μ͹Ζ͏

  5. None
  6. ͕Μ͹Ζ͏

  7. 1FSMͷ্ʹ΋ࡾ೥ ͣͬͱΠέͯΔαʔϏεΛ ࡞Γଓ͚Δٕज़ IJUPEF

  8. IJUPEF

  9. IJUPEF झຯ͸Πϯλʔωοτ

  10. None
  11. None
  12. None
  13. None
  14. ͸ͯͳϒϩά

  15. ͸ͯͳϒϩά ೥݄։ൃ։࢝ ೥݄Ќ൛ ೥݄ਖ਼ࣜԽ ։ൃ೥໨ ·ͩ·ͩ։ൃத

  16. ͸ͯͳϒϩάͷΫϥε਺

  17. ։ൃམͪண͍ͨαʔϏε

  18. ·ͩ·ͩ։ൃத

  19. ΠέͯΔαʔϏεͱ͸

  20. ໾ཱͭ ଎͍ ͨͷ͍͠ ͔͍͍ͬ͜ Πϝʔδ͕Α͍ ΈΜͳ࢖ͬͯΔ

  21. ͦͷͨΊʹ͸ ։ൃΛܧଓ ໎Θͣॻ͚Δ Ұ؏ͨ͠ࢦ਑ ࠷৽ͷࢦ਑

  22. ࣗݾ঺հ ʙࠓ·Ͱ ͸ͯͳϒϩά ࡞ͬͯ·͢

  23. ͍Ζ͍Ζ͋ͬͨͷͰ ͍͍࿩Λ͍ͨ͠

  24. ࿩͍ͨ͜͠ͱ ϑϨʔϜϫʔΫͷྺ࢙ ϒϩάͷϑϨʔϜϫʔΫ ΦϒδΣΫτࢦ޲ ϨΨγʔͳίʔυͷॻ͖׵͑ υϝΠϯۦಈઃܭ ໊લ ৮Γ΍͢͞

  25. ࣾ಺ϑϨʔϜϫʔΫͷྺ࢙

  26. )BUFOB ΞϯςφμΠΞϦʔਓྗ )BUFOB ϒοΫϚʔΫϑΥτϥΠϑάϧʔϓΞΠσΞϦϯά 3JEHF .P$P ϒοΫϚʔΫϋΠΫίίελʔϥϯυ0OF

  27. 3JEHF 3BJMT෩ͷ8"' .P$P "DUJWF3FDPSE෩ͷ03.

  28. 3JEHF package Bookmark::Engine::Index; use strict; use warnings; use Bookmark::Engine -Base;

    sub default : Public { my ($self, $r) = @_; $r->res->content_type('text/plain'); $r->res->content('Welcome to the Ridge world!'); } 1; IUUQTHJUIVCDPNIBUFOB)BUFOB5FYUCPPLCMPCNBTUFSNWDXFCBQQMJDBUJPONE
  29. 3JEHF #PPLNBSL&OHJOF*OEFY #PPLNBSL&OHJOF 3JEHF&OHJOF

  30. 3JEHF DPOUSPMMFS͸ܧঝ Ϋϥε໊͔ΒϧʔςΟϯά

  31. 3JEHF ݁ہશ෦ಡ·ͳ͍ͱ ಈ͔ͤͳ͍ ͷͰ͍ͨ΁Μ

  32. %#*Y.P$0 "DUJWF3FDPSE෩ͷ03. package Vocaloid::MoCo::Artist; use base 'DBIx::MoCo'; __PACKAGE__->table('artist'); my $artists

    = Vocaloid::MoCo::Artist->search( where => { name => { -like => 'ڸԻ%' }, }, order => 'id ASC', limit => 10, ); $artists->each(sub { print $_->name, "\n"; });
  33. .P$P 7PDBMPJE.P$P"SUJTU %#*Y.P$P

  34. 3JEHF .P$P ͱΓ͋͑ͣܧঝ͔ͯ͠Β࢖͏ ෆࢥٞͳग़དྷࣄ͕ى͖Δ ෆࢥٞͳͱ͖ʹίʔυಡΉ

  35. ϓϩδΣΫτ΁ͷ૊ࠐΈ TVCNPEVMFʹ௥Ճ େ͖͍ͷ͔Βখ͍͞ͷ·Ͱ ϓϩδΣΫτʙ

  36. ίʔυ͸ެ։͞ΕͯΔ͚Ͳ ओʹࣾ಺Ͱͷར༻

  37. ޙํޓ׵ੑอͭඞཁ ڍಈͷมߋ͸ϞϯΩʔύον

  38. ͳ͔ͳ͔͍ͨ΁Μͳ͜ͱ΋

  39. %#*Y.P$P-JTU 3VCZͷ"SSBZ෩ͷΠϯλʔϑΣΠε my $artists = Vocaloid::MoCo::Artist->search( where => { name

    => { -like => 'ڸԻ%' }, }, order => 'id ASC', limit => 10, ); $artists->each(sub { print $_->name, "\n"; });
  40. %#*Y.P$P-JTU 3VCZͷ"SSBZ෩ͷΠϯλʔϑΣΠε ϦετΫϥε-JTU3VCZJTI my $artists = Vocaloid::MoCo::Artist->search( where => {

    name => { -like => 'ڸԻ%' }, }, order => 'id ASC', limit => 10, ); $artists->each(sub { print $_->name, "\n"; });
  41. EFMFUF@JG $list = DBIx::MoCo::List->new([1, 2, 3, 4]); $list->delete_if(sub { ($_

    % 2) == 0) }); $list->dump #=> [2, 4] IUUQTNFUBDQBOPSHQPE%#*Y.P$P-JTU
  42. EFMFUF@JG $list = List::Rubyish->new([1, 2, 3, 4]); $list->delete_if(sub { ($_

    % 2) == 0) }); $list->dump #=> [1, 3] IUUQTNFUBDQBOPSHQPE-JTU3VCZJTI
  43. EFMFUF@JG # DBIx::MoCo#delete_if sub delete_if { my ($self, $code) =

    @_; croak "Argument must be a code" unless ref $code eq 'CODE'; my $last_index = $self->_last_index; for (0..$last_index) { my $item = $self->shift; local $_ = $item; $self->push($item) if $code->($_); } return $self; }
  44. EFMFUF@JG # List::Rubyish sub delete_if { my ($self, $code) =

    @_; croak "Argument must be a code" unless ref $code eq 'CODE'; my $last_index = $self->_last_index; for (0..$last_index) { my $item = $self->shift; local $_ = $item; $self->push($item) unless $code->($_); } return $self; }
  45. $self->push($item) if $c

  46. $self->push($item) unles

  47. Ͳ͕ͬͪফ͑Δ͔෼͔Βͳ͍ ϓϩδΣΫτʹΑͬͯ͸ ϞϯΩʔύονͰڍಈม͑ͨΓ ˠEFMFUF@JG͸࢖ͬͯ͸͍͚ͳ͍

  48. ͳ͔ͳ͔͍ͨ΁Μ

  49. ηϚϯςΟοΫͳόʔδϣ χϯά͕͋Ε͹ͪΐͬͱ· ͔ͩͬͨ͠΋͠Εͳ͍

  50. ϥϘ͸ࣗ༝

  51. ϥϘͰ3BJMT

  52. ϥϘͰ4JOBUSB Quyo

  53. ࣾ಺ϑϨʔϜϫʔΫͷྺ࢙ ͓ΘΓ

  54. ͸ͯͳϒϩάͷϑϨʔϜϫʔΫ

  55. :"1$DIP ΅͘ͷ͔Μ͕͍͖͑ͨ͞ΐ ͏ͷ͏͐Ϳ͋΀Γ͚ʔ͠ΐ Μ;ΕʔΉΘʔ͘ IUUQXXXTMJEFTIBSFOFUDIPZBQDBTJB

  56. ͜ͷཪͰൃදத ࠓ͙͢ݟʹߦ͜͏

  57. :"1$DIP ΅͘ͷ͔Μ͕͍͖͑ͨ͞ΐ ͏ͷ͏͐Ϳ͋΀Γ͚ʔ͠ΐ Μ;ΕʔΉΘʔ͘ IUUQXXXTMJEFTIBSFOFUDIPZBQDBTJB

  58. ಡΉίʔυ͕࠷খ ҆શ

  59. ϧʔςΟϯά ηΩϡϦςΟରࡦ

  60. ϒϩάͰ͸ ͋·Γʹγϯϓϧ ܧঝ͠ͳ͍ 03.࢖Θͳ͍ 42-௚઀ॻ͘

  61. $POUSPMMFS ୯ͳΔΫϥεϝιου package Hatena::Epic::Admin::Index; use strict; use warnings; sub default

    { my ($class, $r) = @_; $r->res->content('Hello, World!'); $r->res->content_type('text/plain'); }
  62. $POUSPMMFS 42-΋௚઀ൃߦ package Hatena::Epic::Admin::Index; use strict; use warnings; sub default

    { my ($class, $r) = @_; my $user = $r->db->single( 'SELECT * FROM user WHERE name=:name', bind => { name => 'sampleuser', }, class => 'Model::User', ); $r->render('index.html', {user => $user}); }
  63. $POUSPMMFS͸ͨͩͷؔ਺ 42-΋खͰॻ͘ SFOEFS͢Δ)5.-Λࢦఆ

  64. OP03. 3PXʹCMFTT͢Δ͚ͩ ਌Ϋϥεͳ͠ ୯ͳΔΦϒδΣΫτ

  65. શ෦खॻ͖ ബ͍ϑϨʔϜϫʔΫͰ ͢͹΍͘։ൃ

  66. %3:

  67. ճίϐϖͨ͠Βڞ௨Խ

  68. ճίϐϖͨ͠Βڞ௨Խ ա৒ͳந৅ԽΛආ͚Δ งғؾΑͦ͞͏

  69. ΤϯδχΞਓ

  70. ΤϯδχΞਓ͕ಉ࣌ʹίϐϖ ίϐϖͨ͠42-ʹόά

  71. ΤϯδχΞਓ͕ಉ࣌ʹίϐϖ ίϐϖͨ͠42-ʹόά ճ௚͢

  72. σʔλͷอଘ

  73. DPOUSPMMFS͔Β61%"5& ຖճ޻෉ $POUSPMMFSͰ·ͱΊΔ೿ .PEFMʹTBWFϝιου೿

  74. .PEFM $POUSPMMFS 7JFX ճίϐϖ͞Εͨ૚

  75. ίϐϖղফձ৔ $PNNPO

  76. $PNNPO&OUSZ هࣄʹؔ͢Δૢ࡞ͷ͏ͪ ճίϐϖ͞ΕͨίʔυΛूΊΔ

  77. ݏͳ༧ײ

  78. $PNNPOͩͱ ΰϛஔ͖৔Խͦ͠͏

  79. ໊͍͍લʜ

  80. 4FSWJDF

  81. 4FSWJDF&OUSZ هࣄͷݕࡧ΍อଘͳͲ هࣄͷૢ࡞ΛूΊͨ Ϟδϡʔϧ

  82. ͡Ό͋ͦΕͰ

  83. ݱࡏ 4FSWJDFҎԼʹΫϥε

  84. ݱࡏ 4FSWJDFҎԼʹΫϥε .PEFM͸Ϋϥε

  85. ݱࡏ 4FSWJDFҎԼʹΫϥε .PEFM͸Ϋϥε ςʔϒϧ୯ҐͰ͸ͳ͍

  86. 4FSWJDF %%%తʹ͸3FQPTJUPSZ "QQMJDBUJPO4FSWJDF ͋ͱͰొ৔

  87. ΦϒδΣΫτͷऔಘ my $user = Hatena::Epic::Service::User->find_user_by_name( $db, 'sampleuser' );

  88. my $entries = Hatena::Epic::Service::Entry->find_entries_of_blog( $db, { blog => $blog, permission

    => 'public', limit => 3, }); ΦϒδΣΫτͷऔಘ
  89. ͦͷ࣮૷ 42-खॻ͖ sub find_user_by_name { my ($class, $db, $name) =

    @_; my $user = $db->single( 'SELECT * FROM user WHERE name=:name', bind => { name => $name, }, class => 'Model::User', ); return $user; }
  90. อଘ ϒϩάͷొ࿥ my $blog = Hatena::Epic::Service::Register->register_new_blog( $db, { user =>

    $user, id => 'subdomain', domain => 'hatenablog.com', } );
  91. อଘ ಺෦Ͱ͸*/4&35 sub register_new_blog { my ($class, $db, $values) =

    @_; ... my $blog = $db->execute( 'INSERT INTO blog ...
  92. */4&35Ͱ΋ ؾ࣋ͪ͸ॆ࣮ͨ͠ϝιου register_new_blog join_blog_member post_new_entry reserve_scheduled_entry

  93. DSFBUF@ͩͱ$36%ײ ؾ෼͕ग़ͳ͍ create_blog create_blog_member create_entry find_or_create_scheduled_entry

  94. Πϝʔδ ͜ͷ໊લͷΤϯτϦ͍ͩ͘͞ 4FSWJDF&OUSZ .PEFM&OUSZ ͸͍

  95. Πϝʔδ ͜ͷهࣄอଘ͠ͱ͍ͯ 4FSWJDF&OUSZ .PEFM&OUSZ ͠·ͨ͠

  96. Πϝʔδ ਓؾͷهࣄूܭͯ͠ 4FSWJDF)PU&OUSZ ͠·ͨ͠

  97. 4FSWJDFͷϝιου͸ ୯ͳΔΫϥεϝιου جఈΫϥεͳ͠ جఈΫϥε͸ංେԽ͕ͪ͠ sub register_new_blog { my ($class, $db,

    $values) = @_;
  98. 4FSWJDFͷߟ͑ํ ςʔϒϧͱҰରҰʹ͠ͳ͍ ػೳ͝ͱ

  99. ϒϩάͷओͳςʔϒϧ 6TFS #MPH &OUSZ $PNNFOU

  100. 6TFS #MPH &OUSZ $PNNFOU ͜ΕΒʹू·͍ͬͯ͘ͱ ૿͑͗͢Δ

  101. 1PTU&OUSZ %FMFUF&OUSZ #MPH3FHJTUFS %FTUSPZ"MM4QBNNFST ػೳ໊͝ͱʹ࡞Δ

  102. ݺͼग़͠ଆ͔ΒݟΔͱ ΦϒδΣΫτಉ࢜ͷ ΍ΓͱΓʹݟ͑ΔΑ͏ʹ ۮવ.Z42-ʹอଘͯ͠Δ

  103. ཪଆ.POHP%#Ͱ΋ 8FC"1*Ͱ΋ ಉ͡ΠϯλʔϑΣΠε my $user = Hatena::Epic::Service::User->find_user_by_name( $db, 'sample' );

  104. 4FSWJDFͷొ৔ $POUSPMMFSεοΩϦ

  105. 4FSWJDF͸Ͳ͔͜ΒͰ΋ ࢖͑Δ $POUSPMMFS 5FTU #BUDI4DSJQU 0OFUJNF4DSJQU

  106. ͍͍Ͱ͢Ͷ

  107. ͍͍Ͱ͢Ͷ Ϋϥεϝιου࠷ߴ

  108. ͍͍Ͱ͢Ͷ ͍͍͚Ͳ

  109. ͜Ε͸ ΦϒδΣΫτࢦ޲ͳͷ͔

  110. ͦͷ͜Ζ ΦϒδΣΫτࢦ޲ೖ໳ ಡΜͰͨ

  111. None
  112. ࠷ߴ

  113. 0CKFDU 0SJFOUFE 4PGUXBSF $POTUSVDUJPO

  114. 0CKFDU0SJFOUFE 4PGUXBSF$POTUSVDUJPO ΦϒδΣΫτࢦ޲ೖ໳ ݪஶ͸શવೖ໳͡Όͳ͍ ݪஶ͸೥ ೔ຊޠ൛͸೥

  115. ্Լר  ϖʔδ

  116. ࠷ߴ

  117. ষܖ໿ʹΑΔઃܭ ࠷ߴͷষ

  118. ࣄલ৚݅ࣄޙ৚݅ʜϧʔνϯͷੑ࣭ ෆมද໌ʜΫϥεͷੑ࣭

  119. Ϋϥεͱސ٬ͷؒͷؔ܎ ͸ɼ͓ޓ͍ͷݖརͱٛ຿Λ ݱͨ͠ਖ਼ࣜͳಉҙͱݟͳ͢ ͜ͱ͕Ͱ͖Δ

  120. ެཧ \1^"\2^ ೚ҙͷ"ͷ࣮ߦ͸ɼ1ͷঢ় ଶʹͳͬͨͱ͖ʹ࢝·Γɼ 2ͷঢ়ଶʹͳͬͨͱ͖ʹऴ ྃ͢Δ

  121. ެཧ \1^"\2^ \Y^YY \Y^ ͷؒҧ͍Ͱ͸ͳ͍ ऑ͍৚݅

  122. ࣄલ৚݅  ϧʔνϯͷݺͼग़͠લʹސ٬͕ຬͨ ͞ͳ͚Ε͹ͳΒͳ͍৚݅ ࣄޙ৚݅  ϧʔνϯͷݺͼग़͠ޙʹڙڅऀ͕ຬ ͨ͞ͳ͚Ε͹ͳΒͳ͍৚݅

  123. αΠζʹ্ݶͷ͋ΔελοΫ

  124. ࣄલ৚݅  ελοΫʹۭ͖͕͋Δ͜ͱ ࣄޙ৚݅  ελοΫʹJUFN͕૿͑Δ  αΠζ͕૿͑Δ  ελοΫ͸ۭͰ͸ͳ͍

    $stack->push($item);
  125. ͓ޓ͍ͷ໿ଋ ੹೚֎ͷ͜ͱΛ νΣοΫ͠ͳ͍ ඇ৑௕ੑͷݪଇ

  126. ͓ޓ͍৴པ͢Δ͜ͱͰ ίʔυ͖ͬ͢Γ มͳΤϥʔग़ͨͱ͖ʹ ୭ͷ੹೚͔໌Β͔

  127. Ϋϥεෆมද໌ ΫϥεΠϯελϯεʹ ڞ௨͢Δશମతͳಛੑ

  128. ͋ΔΦϒδΣΫτͷҰੜ create a.make(...) 4 4 a.f(...) 4 a.g(...)

  129. ͋ΔΦϒδΣΫτͷҰੜ create a.make(...) 4 4 a.f(...) 4 a.g(...) ࣄલ ࣄޙ

    ࣄલ ࣄޙ ෆม
  130. ͜ͷߟ͑ํ͸ ΫϥεΛઃܭ͢Δͱ͖ 1FSMͰ΋࢖͑Δ

  131. ࢖͑Δ͚Ͳ ݴޠతͳࢧԉ͸ͳ͍

  132. None
  133. ࢖͑Δ͚Ͳ ݴޠతͳࢧԉ͸ͳ͍ γʔτϕϧτͳ͠Ͱര૸

  134. ্רͷޙ൒ʙԼר͸ Ԇʑͱܧঝͷ࿩

  135. छྨͷܧঝ ෦෼ܕܧঝ Ϗϡʔܧঝ ੍໿ܧঝ ֦ுܧঝ ϑΝϯΫγϣφϧόϦΤʔγϣϯܧঝ ܕόϦΤʔγϣϯܧঝ ແޮԽܧঝ ۩ମԽܧঝ ߏ଄ܧঝ

    ࣮૷ܧঝ ڞ༗ੑ࣭ܧঝ
  136. ΦϒδΣΫτࢦ޲೉͍͠

  137. ೉қ౓ ܧঝ Ϋϥε ؔ਺ ແ ؆୯ ΍Γͨ͘ͳ͍ ೉͍͠

  138. ίʔυߦ΋ ॻ͔ͣʹࡁΊ͹ ͦΕʹӽͨ͜͠ͱ͸ͳ͍

  139. Πϯελϯε࡞Βͣ ܧঝͤͣࡁΊ͹ ͦΕʹӽͨ͜͠ͱ͸ͳ͍

  140. ඞཁͳ͍ΦϒδΣΫτੜ੒ ඞཁͳ͍ܧঝ ؾΛ͚ͭͯ࠷খʹ

  141. ϓϩδΣΫτʹ઎ΊΔࢠΫϥε཰ VTFQBSFOUCBTF཰  

  142. ΞϓϦέʔγϣϯશମͰ ࢖͑Δ΋ͷΛઃܭ͠ ࢖͍ଓ͚Δͷ͸೉͍͠

  143. ঢ়ଶͷͳͯ͘ࡁΉ΋ͷʹ ঢ়ଶΛ༩͑ͯ͸͍͚ͳ͍

  144. ΫϥεϝιουͳΒ৺഑ͳ͍

  145. ΦϒδΣΫτࢦ޲ΛֶΜ্ͩͰ ͳΔ΂͘ෳࡶͳࣄଶΛආ͚Δ

  146. Ϋϥεϝιουͦͷޙ

  147. Ϋϥεϝιου࠷ߴظ ͳΜͰ΋ΫϥεϝιουͰ ෳࡶͳ͜ͱ͢Δ Ҿ਺ͲΜͲΜ૿͍͑ͯ͘

  148. ͍͍Ͱ͢Ͷ Service::PostEntry->post($db, %values);

  149. هࣄ͸ෳࡶ WBMVFTͷLFZ͕ݸʙ Service::PostEntry->post($db, %values); title body date url categories user_id

    blog_id comment_count og_image og_description permission is_scheduled ...
  150. هࣄΛ౤ߘ هࣄΛߋ৽ Լॻ͖ʹ໭͢ Լॻ͖Λߋ৽ ༧໿౤ߘΛެ։ هࣄΛ࡟আ Ϣʔεέʔε͞·͟·

  151. ΤϯτϦͷ૊Έཱͯʹ࢖͏Ϋϥε 1PTU&OUSZ'BDUPSZ

  152. هࣄͷ౤ߘ my $factory = Factory->new; $factory->set_title($title); $factory->set_body($body); $factory->format_body($formatter); ...; $entry

    = $factory->get_entry;
  153. Լॻ͖ͷެ։ my $factory = Factory->new; $factory->load_entry($draft); $factory->set_as_public; my $entry =

    $factory->get_entry;
  154. ެ։هࣄΛԼॻ͖ʹ໭͢ my $factory = Factory->new; $factory->load_entry($entry); $factory->set_as_private; my $draft =

    $factory->get_entry;
  155. ೉͍͠ૢ࡞ ॊೈͳΠϯλʔϑΣΠε ෳ਺ਓฤू΍༧໿౤ߘͳͲ ࡞ΕΔΑ͏ʹͳͬͨ

  156. ͋ΔΦϒδΣΫτͷҰੜ create a.make(...) 4 4 a.f(...) 4 a.g(...)

  157. ͍ͯͶ͍ʹ࡞Δͱ ໾ʹཱͭ ΦϒδΣΫτࢦ޲࠷ߴ

  158. ࠷ߴ

  159. ͖ͷ͏ؾ෇͍ͨ

  160. Լר ࡏݿͳ͍

  161. ͩΜͩΜΑ͘ͳ͖͚ͬͯͨͲ ੲॻ͍ͨίʔυ͕େྔʹ͋Δ

  162. ςετίʔυʹ ಉ͡42-͕ ݸ͘Β͍ 4&-&$5 '30.FOUSZ

  163. શ෦ม͑Δͷ͍ͨ΁Μ ੩తղੳͯ͠ॻ͖׵͑

  164. ੩తղੳ ڈ೥ͷൃදΛݟͯ͘Ε

  165. print (1 * 2) + 3; ߏจ໦

  166. ‘;’ ߏจ໦ ‘print’ ‘ ‘ List ‘ ‘ ‘ ‘

    ‘1’ ‘ ‘ ‘*’ ‘ ‘ ‘2’ ‘+’ ‘3’ Statement Document print (1 * 2) + 3;
  167. ߏจ໦ print "(1 * 2) + 3";

  168. ‘;’ ߏจ໦ ‘print’ ‘ ‘ Statement Document print "(1 *

    2) + 3"; ‘"(1 * 2) + 3"’
  169. ͜͏͍͏΍ͭͰ ಛఆͷτʔΫϯྻΛஔ׵ ͢Δ΍ͭ࡞ͬͨ

  170. 4&-&$5 '30.FOUSZ ˣ 4FSWJDF&OUSZpOE@FOUSZ

  171. 3FQMBDF.FUIPE$BMM IUUQIJUPEFIBUFOBCMPHDPNFOUSZ

  172. ओʹςετͰίϐϖ͞Ε· ͬͯͨ͘42-Λ 4FSWJDF૚ʹҠৡ

  173. εΫϦϓτͰճͯ͠ίϛοτ ߦ΄Ͳػցతʹมߋ

  174. "QQ135 1FSMͷϦϑΝΫλϦϯά πʔϧ࡞Γ·ͨ͠ ;ͩΜ͍͢͝࢖ͬͯΔ ڈ೥ͷൃදݟͯ͘Ε

  175. ௕೥։ൃͯ͠Δͱ ஌ݟू·ͬͯ͘Δ ৽͍͠ࢦ਑ʹ͋Θͤͯ ͋ͱ͔Β௚ͤΔͷ͕ॏཁ

  176. աڈΛࣺͯ ࠷ߴͷઃܭʹ ޲͔͍͍ͨ

  177. None
  178. ࠷ߴ

  179. ΤϦοΫɾΤϰΝϯεͷ υϝΠϯۦಈઃܭ ग़൛ ೔ຊޠ൛ ,JOEMF൛

  180. ίΞυϝΠϯʹूதͯ͠ ॆ࣮ͨ͠ϞσϧΛ࡞Ζ͏

  181. ίΞυϝΠϯ ιϑτ΢ΣΞͷ͏ͪ ΋ͬͱ΋ॏཁͰ೉͍͠ͱ͜Ζ

  182. ίΞυϝΠϯʹ஫ྗ ίΞυϝΠϯҎ֎Ͱ ࡞ΓࠐΈ͗͢Δͱແବ

  183. ϨΠϠԽΞʔΩςΫνϟ

  184. ϨΠϠԽΞʔΩςΫνϟ ϢʔβΠϯλϑΣʔε ΞϓϦέʔγϣϯ υϝΠϯ ΠϯϑϥετϥΫνϟ

  185. ϨΠϠԽΞʔΩςΫνϟ ϢʔβΠϯλϑΣʔε ΞϓϦέʔγϣϯ υϝΠϯ ΠϯϑϥετϥΫνϟ ৘ใͷදࣔɼίϚϯυͷղऍ ௐ੔໾ബ͍૚ Ϗδωεϧʔϧ ιϑτ΢ΣΞͷ֩৺ ӬଓԽ΍ϝοηʔδૹ৴ͳͲ

    Ұൠతͳٕज़
  186. υϝΠϯͷΦϒδΣΫτ ΤϯςΟςΟ ஋ΦϒδΣΫτ

  187. ΤϯςΟςΟ Ϣʔβʔ΍ϒϩά ঢ়ଶΛ࣋ͭ ಉ໊͡લͰ΋ผΠϯελϯε Ұҙͷ*%

  188. ஋ΦϒδΣΫτ ෆมͳ΋ͷ ྫ৭ɼ਺ࣈɼ਺ ΠϯελϯεΛڞ༗Ͱ͖Δ

  189. ͸ͯͳϒϩάʹ͓͚Δ ΤϯςΟςΟͷྫ  .PEFM6TFS  .PEFM#MPH  .PEFM&OUSZ

  190. ͸ͯͳϒϩάʹ͓͚Δ ஋ΦϒδΣΫτͷྫ .PEFM#MPH1MVT#BEHF

  191. ΤϯςΟςΟͱ ஋ΦϒδΣΫτ ҙࣝͯ͠࡞Δͱ ߟ͑Δ͜ͱ͕ݮΔ

  192. ΤϯςΟςΟ͍ͨ΁Μ ͳΔ΂͘஋ΦϒδΣΫτʹ

  193. ΤϯςΟςΟͷҰੜ create a.make(...) 4 4 a.f(...) 4 a.g(...)

  194. ஋ΦϒδΣΫτͷҰੜ create a.make(...) 4 ঢ়ଶͳ͠

  195. ͦͷଞ αʔϏε

  196. αʔϏε υϝΠϯͷૢ࡞Ͱ͋Γͳ͕ ΒΤϯςΟςΟʹ΋஋Φϒ δΣΫτʹ΋མͪண͔ͳ͍

  197. ঢ়ଶΛ࣋ͨͳ͍αʔϏεͱ ͯ͠ಠཱͤ͞Δ ྫޱ࠲ͷৼସػೳ

  198. $POUSPMMFS͔Β୤ग़ͨ͠ ͱ͜Ζ4FSWJDFʹ୧Γͭ ͍͚ͨͲυϝΠϯۦಈઃܭ తʹ͸Ұൠతͳ֓೦ͩͬͨ

  199. ࠷ߴ

  200. ࠷ۙͷϓϩδΣΫτ %%%ΛऔΓೖΕΑ͏

  201. ͸ͯͳϒοΫϚʔΫ ϑϧεΫϥονத XJUI4DBMB

  202. 4DBMBؔ੢4VNNJU ͸ͯͳϒοΫϚʔΫJO4DBMB IUUQXXXTMJEFTIBSFOFUPBSBUTDBMB

  203. None
  204. υϝΠϯۦಈઃܭχϡʔε

  205. None
  206. ࠷ߴ

  207. ࣮ફυϝΠϯۦಈઃܭ ۩ମతͳ࣮૷ +BWB )JCFSOBUF .POHP%#

  208. ࣾ಺Ͱษڧձ िষ ͏ͪͷϓϩδΣΫτͰ͸ʙ ײ૝΍࣭໰͸ (JU)VC*TTVF

  209. None
  210. None
  211. ΈΜͳͰಡΉͱ௙Δ

  212. ʮ͸ͯͳࣾ಺Ͱ։࠵ͨ͠ %%%ษڧձͷ༷ࢠΛ͝঺ հ͠·͢ʯ IUUQEFWFMPQFSIBUFOBTUB⒎DPNFOUSZ

  213. ໊લͷ࿩

  214. ϢϏΩλεݴޠ νʔϜͰڞ༗͢Δݴޠ ීஈͷձ࿩͔Βίʔυ·Ͱ

  215. શһ͕ಉ͡ݴ༿Ͱ࿩ͤΔͱ௙Δ

  216. ٬ʮে༉ʯ ৬ਓʮࢵʯ ࣮ࡍʹ͸ಉ͡΋ͷΛࢦ͢

  217. σΟϨΫλʔʮ͓Έ͘͡ʯ ΤϯδχΞʮ-PUΫϥεʯ ࣮ࡍʹ͸ಉ͡΋ͷΛࢦ͢

  218. ͜ΕͰ͸͍͚ͳ͍

  219. ΤϯδχΞ΋ σΟϨΫλʔ΋ σβΠφʔ΋ اը΋ฤू΋ νʔϜϝϯόʔશһ ಉ͡ݴ༿Λ࿩͢

  220. ৽نҊ݅Λ࢝ΊΔͱ͖ͷձ࿩ ʮ˓˓ͱººɼ;ͩΜͲͬͪͰݺͼ·͔͢ʯ ʮºº͔ͳʯ ʮººΫϥε࡞Γ·͢ʯ ʮºº͸˚˚͠·͔͢ʯ ʮºº͸˘˘͠·͢ʯ ˠººΫϥεʹ˘˘ϝιου࡞Δ

  221. None
  222. DMBTT0NJLVKJ DMBTT0NJLVKJ$PNQPOFOU DMBTT0NJLVKJ7JFX PNJLVKJVSBOBV

  223. ೔ຊޠ͕͍͍͔͸ٞ࿦ͷ༨஍ JGPNJLVKJFNQUZ NPTJPNJLVKJLBSB

  224. ೔ຊޠ͕͍͍͔͸ٞ࿦ͷ༨஍ ެ༻ޠ͕ӳޠͩͱΑ͍ JGPNJLVKJFNQUZ NPTJPNJLVKJLBSB

  225. ·ͩ·ͩ͜Ε͔Β

  226. ͸ͯͳϒϩά΋ ౷ҰͰ͖ͯͳ͍

  227. αΠυόʔʹஔ͚Δ΍ͭ

  228. αΠυόʔʹஔ͚Δ΍ͭ ΢ΟδΣοτ Ϟδϡʔϧ

  229. ϓϩδΣΫτ໊ ͸ͯͳϒϩά

  230. ίʔυωʔϜ &QJD

  231. )BUFOB&QJD 1FSM )BUFOB%JBSZ +4 )BUFOB#MPH $IFG

  232. OFX)BUFOB%JBSZ#MPHT#MPH

  233. OFX)BUFOB%JBSZ#MPHT#MPH ϓϩδΣΫτ໊ ϒϩάΛ഑৴͢ΔυϝΠϯ ϒϩάͭΛ͋ΒΘ͢Ϟσϧ

  234. ·ͩ·ͩ͜Ε͔Β

  235. ໊લͷ؅ཧ

  236. ༻ޠूNE νʔϜϝϯόʔͰ߹ҙ͔ͯ͠Βهೖ HJUͰ؅ཧ ΤϯςΟςΟͷछྨ ʮ˓˓ϖʔδʯͱ͔ ϝϯόʔ૿͑ͨͱ͖ʹָ ߋ৽ΊΜͲ͏

  237. ίϝϯτʹॻ͘ ࣮૷ͱͷဃ཭͕গͳ͍ ϒϩάνʔϜͰ͸ฤू΍اըͷਓʹ ΋͔·ΘͣίʔυΛݟ͍ͤͯΔ ʮͪΐͬͱ͸Կ΍ͬͯΔ͔Θ͔ͬͨʯ

  238. ձ࿩ l࠷΋௕ظؒϢϏΩλεݴޠͷݱঢ়Λ ͖ͪΜͱද͠ଓ͚Δͷ͸ɼνʔϜͰ ͷձ࿩΍ίʔυ಺ͷϞσϧͩɽz ࣮ફυϝΠϯۦಈઃܭ1

  239. ΄͔ͷ࿩୊

  240. ίʔυ͸ม͑ΒΕΔ ετϨʔδ͸Ή͔͍ͣ͠ BMUFSUBCMF ஌ݟืू

  241. ޷ධ ൃചத

  242. ৮Γ΍͢͞

  243. ͸ͯͳΠϯλʔϯ ʙ

  244. None
  245. ϒϩάνʔϜͰ͸ ೥͔Β Πϯλʔϯੜड͚ೖΕ

  246. None
  247. None
  248. None
  249. None
  250. None
  251. None
  252. νʔϜ഑ଐ͔Β िؒͷ͏ͪʹ Կ౓͔ϦϦʔε Կ౓͔ࠂ஌

  253. ͸ͯͳڭՊॻ (JU)VCͰެ։த IUUQTHJUIVCDPNIBUFOB)BUFOB5FYUCPPL

  254. ΠϯλʔϯڭՊॻ ੲ͸3JEHF .P$P ϒϩάͷΞʔΩςΫνϟΛ΋ͱʹ࡮৽ ৽ਓݚमͰ΋

  255. ༨ܭͳ͜ͱ͠ͳ͍ͷͰ ؾʹͳͬͨΒશ෦ಡΊΔ

  256. ࠓ೥ͷΠϯλʔϯ ͓ͱͱ͍഑ଐ ΋͏৽ػೳಈ͖ͭͭ͋Δ

  257. ΦϒδΣΫτࢦ޲΍%%% ؾʹ͠ͳͯ͘΋ γϯϓϧʹॻ͚Δ

  258. ·ͱΊ

  259. ࿩͍ͨ͜͠ͱ ϑϨʔϜϫʔΫͷྺ࢙ ϒϩάͷϑϨʔϜϫʔΫ ΦϒδΣΫτࢦ޲ ϨΨγʔͳίʔυͷॻ͖׵͑ υϝΠϯۦಈઃܭ ໊લ ৮Γ΍͢͞

  260. ·ͱΊ ΋͏͙͢೥ ·ͩ·ͩΠέΔ ߴ଎ʹ։ൃͰ͖Δ

  261. ͍ͪͲ1FSM͔Βग़ͯ ΦϒδΣΫτࢦ޲΍%%% ֎ͷੈքͷ஌ݟΛ 1FSMʹ࣋ͬͯؼΔ

  262. ׬