Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

YAPC::KANSAI 2017 LT

746 views

Published on

YAPC::KANSAI 2017 OSAKA のLT

Published in: Technology
  • If you want to download or read this book, Copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • If you want to download or read this book, Copy link or url below in the New tab ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THI5 BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THI5 BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (Unlimited) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ACCESS WEBSITE for All Ebooks ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m77EgH } ......................................................................................................................... Download EPUB Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... Download doc Ebook here { http://bit.ly/2m77EgH } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

YAPC::KANSAI 2017 LT

  1. 1. YAPC::Kansai 2017 OSAKA LT まかまか般若波羅蜜@どんぞこ楽屋 所属:国際展示場前.pm 驚くべきことに Perlの話
  2. 2. 驚くべきことに Perlの話 2 / 244
  3. 3. 驚くべきことに 3 / 244
  4. 4. LTに応募したことが 記憶になかった 4 / 244
  5. 5. 第一部 某slackにて
  6. 6. 6 / 244
  7. 7. Time::Piece 日時を扱う Perlのコアモジュール 7 / 244
  8. 8. 8 / 244
  9. 9. my $t = Time::Piece->new $t->yyyymmdd; # 20170304 10 / 244
  10. 10. $t->yyyy-mm-dd(); # 2017-03-04 $t->dd-mm-yyyy(); # 04-03-2017 etc. 11 / 244
  11. 11. $t->yyyy-mm-dd(); # 2017-03-04 $t->dd-mm-yyyy(); # 04-03-2017 etc. Perlのメソッドは ハイフンとか使えないから 無理ゲーよね、と
  12. 12. ……ん? 13 / 244
  13. 13. できる! できるぞ! 14 / 244
  14. 14. overload 15 / 244
  15. 15. overload 演算子オーバーロード 16 / 244
  16. 16. package Foo; overload ( ‘+’ => sub { ... }, ‘-’ => sub { ... }, ); ... my $foo = Foo->new; $foo + 1; 3 - $foo; $foo--;
  17. 17. 方針: yyyy, mm, ddをインポート それらの関数は-や/をoverloadした オブジェクトを返す 18 / 244
  18. 18. package Time::Piece::YYYYMMDD; use strict; use warnings; BEGIN { require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(mm dd yyyy); } use parent 'Time::Piece'; 19 / 244
  19. 19. sub yyyy { _make_obj('%Y', shift); } sub mm { _make_obj('%m', shift); } sub dd { _make_obj('%d', shift); } 20 / 244
  20. 20. sub _make_obj { my ($type, $obj) = @_; if ( defined $obj ) { if ( $obj->isa('Time::Piece::YYYYMMDD::Object') ) { push @{$obj->{types}}, $type; return $obj; } else { # $obj is a Time::Piece::YYYYMMDD bless { t => $obj, types => [$type] }, 'Time::Piece::YYYYMMDD::Object'; } } else { bless { t => undef, types => [$type] }, 'Time::Piece::YYYYMMDD::Object'; } } 21 / 244
  21. 21. package Time::Piece::YYYYMMDD::Object; use overload ( '-' => _kigo('-'), '/' => _kigo('/'), ); 22 / 244
  22. 22. BEGIN { sub _kigo { my ( $kigo ) = @_; return sub { # オーバーロードされた演算子で呼ばれる my ( $self, $other, $swap ) = @_; my $t = $self->{t}; my $type = $self->{type}; if ($swap) { push @{ $self->{types} }, $kigo; return $self; } else { push @{ $other->{types} }, $kigo; } my @types = (@{$self->{types}}, reverse(@{$other->{types}})); return $t->strftime(join('', @types)); }; } }
  23. 23. use Time::Piece::YYYYMMDD; my $t = Time::Piece::YYYYMMDD->new; $t->yyyy-mm-dd; 24 / 244
  24. 24. use Time::Piece::YYYYMMDD; my $t = Time::Piece::YYYYMMDD->new; $t->yyyy-mm-dd; #### $ perl -MO=Deparse test.pl 25 / 244
  25. 25. use Time::Piece::YYYYMMDD; my $t = Time::Piece::YYYYMMDD->new; $t->yyyy-mm-dd; #### $ perl -MO=Deparse test.pl $t->yyyy - mm(-dd()); 26 / 244
  26. 26. $t->yyyy - mm(-dd()); dd() が呼ばれ%Dをスタックに積んだオブジェクト返す -が呼ばれ – をさっきのオブジェクトのスタックに積む mm() が呼ばれ%Mをスタックに積む -が呼ばれ – をスタックに積む。さらに yyyy() で返されたオブジェクトを引数で受けてるので ここまでの情報が積まれたオブジェクトとがっちゃんこ 27 / 244
  27. 27. いい感じになるので $VAR1 = [ '%Y', '-', '%m', '-', '%d' ]; これを strftime に渡す 28 / 244
  28. 28. say $t->yyyy-mm-dd; say $t->mm-dd; say $t->yyyy-mm; say $t->dd-mm-yyyy; say $t->mm/dd; 29 / 244
  29. 29. say $t->yyyy-mm-dd; 2017-03-04 say $t->mm-dd; 03-04 say $t->yyyy-mm; 2017-03 say $t->dd-mm-yyyy; 04-03-2017 say $t->mm/dd; 03/04 30 / 244
  30. 30. やったー! 31 / 244
  31. 31. ……ん? 32 / 244
  32. 32. say $t->yyyy-mm-dd; 2017-03-04 say $t->mm-dd; 03-04 say $t->yyyy-mm; 2017-03 say $t->dd-mm-yyyy; 04-03-2017 say $t->mm/dd; 03/04 33 / 244
  33. 33. say $t->mm/dd; 03/04 34 / 244
  34. 34. say $t->mm/dd; 03/04 say $t->yyyy/mm/dd; ...? 35 / 244
  35. 35. say $t->yyyy/mm/dd; Search pattern not terminated 36 / 244
  36. 36. say $t->yyyy/mm/dd; Search pattern not terminated TerminateしないのにThe END 37 / 244
  37. 37. 第一部 完
  38. 38. 39 / 244
  39. 39. 40 / 244
  40. 40. 41 / 244
  41. 41. 41 / 244
  42. 42. 41 / 244
  43. 43. 51 / 244
  44. 44. 51 / 244
  45. 45. 51 / 244
  46. 46. 80 / 244
  47. 47. 80 / 244
  48. 48. 80 / 244
  49. 49. 100 / 244
  50. 50. 100 / 244
  51. 51. 100 / 244
  52. 52. 100 / 244
  53. 53. 100 / 244
  54. 54. 100 / 244
  55. 55. 第二部 昨年のPerlの同人活動 (2016年夏・冬コミ)
  56. 56. Acme大全2016 231 / 244
  57. 57. Acme大全2016 232 / 244
  58. 58. Acme大全2016 615個の Acmeモジュール 233 / 244
  59. 59. 昔Parumonっていう Perl Monger なりきりカードゲーム をつくったよ 234 / 244
  60. 60. 納期が襲ってくるので CPANモジュールを 駆使して進捗を 達成する協力型ゲーム 235 / 244
  61. 61. ボードゲームに 移植したよ 237 / 244
  62. 62. デバッグしないで 公開したから メッチャ ゲームバランス悪い
  63. 63. 一番の問題点は 納期が襲ってこない 240 / 244
  64. 64. 穏やかなゲームになった 241 / 244
  65. 65. なお、会場でこのゲーム の説明をすると 242 / 244
  66. 66. 皆口をそろえて ゲームでまで納期の ことを考えたくないと 243 / 244
  67. 67. 汚いものを見る様な目で 244 / 244
  68. 68. 第三部 今後のPerlの同人活動 1000 / 244
  69. 69. 技術書典2 2000 / 244
  70. 70. え-25 2000 / 3004
  71. 71. YAPC::Kansai 2017 LT おしまい 驚くべきことに Perlの話 2017/03/04

×