1 / 79

Language Update Perl

Language Update Perl. (小飼弾さんの代理) 竹迫 良範. LL イベント の歴史を 振り返る. LL Saturday ( 2003 ). LL Weekend ( 2004 ). LLDN ( 2005 ). 実態:スクリプト言語ヲタの祭り. Web サイト. 小飼弾. さん. キタ━━ ( ゚∀゚ )━━ ッ !!. ここで、会場の 皆様に 質問. require Dan::Kogai. もちろん!. require Dan::Kogai. ↓ require jcode.pl ?. Perl4  Perl5

chico
Download Presentation

Language Update Perl

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Language UpdatePerl (小飼弾さんの代理) 竹迫 良範

  2. LLイベント の歴史を 振り返る

  3. LL Saturday (2003)

  4. LL Weekend (2004)

  5. LLDN (2005) 実態:スクリプト言語ヲタの祭り

  6. Web サイト

  7. 小飼弾 さん キタ━━(゚∀゚)━━ッ!!

  8. ここで、会場の皆様に 質問

  9. require Dan::Kogai もちろん!

  10. require Dan::Kogai ↓ require jcode.pl ? Perl4  Perl5 jcode.pl  Jcode.pm ↓ use (J|En)code;

  11. use Dan::Kogai 弾さんを使おう

  12. キミならどう書く 2.0前哨戦 Round 1 お題 「100までの素数を列挙せよ」

  13. Brainf*ckで100までの素数を列挙してみるテスト

  14. Excel VBAで素数 featuring イルカ http://d.hatena.ne.jp/kkkkkkkk/20060620/p1 冴子先生

  15. もちろんイルカくんも・・・

  16. 雑誌やブログの記事に書かれている Perlのコードを弾さんが添削してくれる すばらしい連載企画 勝手に添削コーナー

  17. プロダクションスクリプトに use strict; をつけないと、 左手のサイコレーターが TBをあびせるぞ! http://blog.livedoor.jp/dankogai/archives/50449002.html

  18. 【ITレスラー戦国伝】タブとスペース抗争の巻【ITレスラー戦国伝】タブとスペース抗争の巻 • 登場人物 • サイボウズ科学戦隊所属のITレスラー • 【燕(つばくろ)のKazuho】 • 無所属のITレスラー【ストロング弾】 • 謎のITレスラー【ムッシュ石垣】 • Six ApartのITレスラー【南斗せきむら】 • LD所属のITレスラー • 【キャプター疾風(はやて)】 • iY所属のITレスラー【魔人イヤプー】 http://b.hatena.ne.jp/entry/http://d.hatena.ne.jp/knifestyle/20060430/p1

  19. 【ITレスラー戦国伝】タブとスペース抗争の巻【ITレスラー戦国伝】タブとスペース抗争の巻 • スペース派閥 • C 系の言語 は 4 、Ruby は 2 • いや、Ruby は 3 スペでしょ • タブ(萌ディタ流派) • タブで揃えて、萌ディタでタブ幅を動的に切り替え • 保存時に変換 • 君たちは、patchのことをきれいさぱーり忘れている。 • 人にpatchを送るときには、必ずperl -i.bak -ple 's{^(\t+)}{q( ) x (length($1)*4)}e' old.plとしていただきたい。 • 秀丸エディタで、CTRL+A → ALT+E → V → S とするとタブをスペースに変換(約0.2秒) • そのタブAcme::Tabifyでよくね?Plaggerでもいいけど

  20. 添削希望のコードをブログで公開するメソッド添削希望のコードをブログで公開するメソッド http://rebecca.ac/milano/mt/archives/001383.html

  21. Perlのスローガン TMTOWTDI There's more than one way to do it.

  22. Danさんの場合 TMDTWTDI There's more Dan the way to do it.

  23. 結論 Danさんの実装も快く受け入れるのが Perlの文化

  24. Language UpdatePerl Shibuya.pm 竹迫 良範

  25. Perl6 の開発状況 ←いまここ

  26. Pugsの登場(2005年) 多態型    存在型   帰納的  λλλλλλ

  27. Haskell

  28. Perl 6 で何が変わるの? 素朴な疑問

  29. 5秒でわかる Perl6 • メソッド呼び出しを . で書けるようになった Perl5 Perl6 $obj->method(); $obj.method(); → これで Perl も立派なOO言語の仲間入り!

  30. めでたし、めでたし 終了

  31. Perl 5  6 のUpdate について もうちょっと詳しく・・・

  32. Perl6で失ったもの ~後方互換性~ • 文字列の連結は .(ドット)→ ~(チルダ)に Perl5 Perl6 # メソッド呼び出し $obj.method(); my $a = “A"; sub func { return "x"; } # 文字列の連結 my $b = $a~func(); # メソッド呼び出し $obj->method(); my $a = “A"; sub func { return "x"; } # 文字列の連結 my $b = $a.func();

  33. 配列とハッシュのアクセス方法が変更 • はじめての人にもわかりやすく • 変数のプレフィクス $@% ルールが変更 Perl5 Perl6 my @array = (1, 2, 3); my %hash = ('a'=> 1); # 配列のメンバにアクセス my $x = $array[0]; # ハッシュのメンバにアクセス my $y = $hash{'a'} my @array = (1, 2, 3); my %hash = ('a'=> 1); # 配列のメンバにアクセス my $x = @array[0]; # ハッシュのメンバにアクセス my $y = %hash{'a'}

  34. Piping operators(<==, ==>) Perl6 @result = map { floor($^x / 2) } grep { /^ \d+ $/ } @data; @result <== map { floor($^x / 2) } <== grep { /^ \d+ $/ } <== @data; @data ==> grep { /^ \d+ $/ } ==> map { floor($^x / 2) } ==> @result;

  35. 括弧省略 • if, for, while, do ブロックでの(括弧省略) • キータイプの量が少なくなった Perl5 Perl6 if ($a eq $b) { print "a=b\n"; } while ($i > 0) { $i--; } if $a eq $b { say "a=b"; } while $i > 0 { $i--; }

  36. Neko operator(ネコ演算子) • Damian Conway氏が OSCON2005 で発音 • 末尾を含まない「..^」 • 先頭を含まない「^..」 • 先頭と末尾を含まない「^..^」 Perl6 my @a = (1..^5); # (1,2,3,4) my @b = (1^..5); # (2,3,4,5) my @c = (1^..^5); # (2,3,4) http://www.rubyist.net/~matz/20050803.html

  37. ネコ演算子って・・・ちょwおまwww ネコ耳モード♪ ^..^ Illustration by SUGIMOTO Yoshiaki June 25, 2005 http://catzpaw.net/~www/gal/sugz042b.html

  38. CPAN Recently Update

  39. ■ 2006年: 現在2941個のモジュールがリリース http://cpants.perl.org/graphs.html

  40. Moose.pm クラス定義をスマートに

  41. Perl6 (Pugs)

  42. Perl5 (Moose.pm)

  43. Moose.pm サブクラスの作成 (派生クラスの継承)

More Related