☺{{#c|Pugs}}☻ The Second Year {{#q|唐鳳}} ---- {{#c| 9:00 Pugs 初探}} {{#h|10:00 問答}} {{#h|10:20 中場休息}} {{#h|10:40 }}{{#q|…還不知道要講什麼}} {{#h|11:40 問答}} ---- Pugs {{#c|初探}} ---- {{img src="/img/spacer.gif"> +? } rule term { <comment> | <alternation> | <non_alternation> } rule comment { \\# \\N* } rule alternation { <non_alternation> \\| <term>+? } rule non_alternation { … } } ---- {{#c|✓ 物件}} ---- (1..10){{#c|.}}map:{{#pre|{}}{{#c|.}}sqrt}{{#c|.}}yaml{{#c|.}}say; ---- {{#c|✓ 結合值}} ---- if $x == 2{{#c||}}3{{#c||}}5 { … } ---- {{#c|✓ 多重函式}} ---- {{#c|multi}} add ($x) { $x } {{#c|multi}} add (Num $x, Num $y) { $x + $y } {{#c|multi}} add (Str $x, Str $y) { $x ~ $y } ---- {{#c|←}} ---- 內嵌 {{#c|← Perl5}} ---- ← Perl5 {{#c|← Parrot}} ---- ← Perl5 ← Parrot {{#c|← Haskell}} ---- {{#c|⇒}} ---- PIL {{#c|編譯器}} ---- {{#c|P}}ugs {{#c|I}}ntermediate {{#c|L}}anguage ---- {{#c|中繼}} 語言 ---- 產生目的碼 {{#c|⇒ Perl5}} ---- ⇒ Perl5 {{#c|⇒ Parrot}} ---- ⇒ Perl5 ⇒ Parrot {{#c|⇒ JavaScript}} ---- {{img src="/img/spacer.gif"> 1, y => 1, z => 0, @_);}} … } ---- {{#ui|# Perl 5}} sub render { my $self = shift; my %opts = (x => 1, y => 1, z => 0, @_); for my $item ({{#c| $self->filter(@{ $self->{_items} } }}) { … } } ---- $MOOSE = {{#ui|# Perl 5}} sub render { my $self = shift; my %opts = (x => 1, y => 1, z => 0, @_); for my $item ( $self->filter(@{ $self->{_items} }) ) { {{#c| print $item->draw( }} {{#c| x => $opts{x}, }} {{#c| y => $opts{y}, }} {{#c| z => $opts{z}, }} ), \"\\n\"; } } ---- $_ = $MOOSE.color(/(\), .*)/); ---- {{#ui|# Perl 6}} method render {{#c|($x = 1, $y = 1, $z = 0)}} { … } ---- {{#ui|# Perl 6}} method render ($x = 1, $y = 1, $z = 0) { for {{#c|@.filter(@.items)}} { … } } ---- {{#ui|# Perl 6}} method render ($x = 1, $y = 1, $z = 0) { for @.filter(@.items) { {{#c|say .draw(:$x, :$y, :$z);}} } } ---- 印記 {{#c|≆}} 參照 {{#x|☣}} ---- {{#iu|Perl 1}} {{#c|$s @a}} {{#c| }} ---- {{#iu|Perl 1}} {{#h|$s @a }} {{#c| $a[0] $h{'?'} }} ---- {{#iu|Perl 3}} {{#h|$s @a }}{{#c|%h}} {{#h| $a[0] $h{'?'} }} ---- {{#iu|Perl 5}} {{#h|$s @a %h}} {{#c|$$s}}{{#h| $a[0] $h{'?'} }} ---- {{#iu|Perl 5}} {{#h|$s @a %h}} {{#c|@}}{{#h|$s $a[0] $h{'?'} }} ---- {{#iu|Perl 5}} {{#h|$s @a %h}} {{#c|%}}{{#h|$s $a[0] $h{'?'} }} ---- {{#iu|Perl 5}} {{#h|$s @a %h}} {{#c|$$s}}{{#h| $a[0] $h{'?'} }} ---- {{#iu|Perl 5}} {{#h|$s @a %h}} {{#h|$$s $a[0] $h{'?'} }} {{#c|$s->foo}}{{#x| ☹ ☹}} ---- {{#iu|Perl 6}} {{#h|$s @a %h}} {{#h|$$s }}{{#c|@a}}{{#h|[0] }}{{#c|%h<?> }} {{#c|$s.foo @a.foo %h.foo }} ☺ ---- 執行環境 {{#c|疊疊樂}} {{#x|☣}} ---- {{img src="/img/spacer.gif"> 0 } … ---- subset Positive of Num where { $$_ > 0 } sub f ( {{#c|Positive}} $x, {{#c|Positive}} $y --> {{#c|Positive}} where { $$_ >= ($x & $y) } ) { sqrt($x ** 2 + $y ** 2); } … ---- subset Positive of Num where { $$_ > 0 } sub f ( Positive $x, Positive $y --> Positive where { $$_ >= ($x & $y) } ) { sqrt($x ** 2 + $y ** 2); } my $five {{#c|:=}} f(3, 4); {{#ct|# 型別為 Positive}} ---- 惰性求值 {{#ci|vs.}} 先行求值 ---- 串流 {{#c|生成式}} ☼ ---- my {{#c|@fib}} := ( 0, 1, each({{#c|@fib}}; {{#c|@fib[1…]}}) .map(&infix:<+>) ); ---- my $ignored = {{#c|lazy}} { 9 ** 9 ** 9 } my $unused = {{#c|lazy}} { say [1..$ignored] } print \"Hello, world!\"; ---- 彈性語法 {{#ci|vs.}} 簡明解析 ---- 文法 {{#c|範疇}} ☼ ---- sub {{#c|postfix:<!>}} ($x) { [*] 1..$x } say 10{{#c|!}}; {{#t|# 3628800}} ---- macro {{#c|circumfix:</* */>}} ($x) is parsed / .*? / { '' } {{#t|/* 這是類似 C 語言的註解 */}} ---- 進化 {{#ci|vs.}} 安全 ---- 可組合式 {{#c|巨集}} ☼ ---- {{{ {{#c|q:code}}/ use $$_ / for < DBI CGI PPI > }}} ---- macro hi () { {{#c|q:code(:COMPILING)}} { \"Hello, $s\" } } my $s = 'world'; say hi; {{#t|# Hello, world}} ---- 類型式物件 {{#ci|vs.}} 原型式物件 ---- 元物件 {{#c|協定}} ☼ ---- class Dog {{#c|is}} Mammal {{#c|does}} Pet { {{#c|my}} $count where 0..100; {{#c|has}} $!brain; has $name {{#c|is rw}} = 'fido'; has $fur {{#c|handles}} Groomable; has $tail handles <wag hang>; has &vocalize = &say; method owner () {{#c|handles}} s/^owner_// { … } } ---- {{#c|my Dog $fido .= new;}} … ---- my Dog $fido .= new; {{#ct|# Dog.isa(Dog); $fido.isa(Dog);}} … ---- my Dog $fido .= new; {{#t|# Dog.isa(Dog); $fido.isa(Dog);}} $fido{{#c|.meta.add_method}}( 'bark', method () { $.vocalize('Woof!') } ); … ---- my Dog $fido .= new; {{#t|# Dog.isa(Dog); $fido.isa(Dog);}} $fido.meta.add_method( 'bark', method () { $.vocalize('Woof!') } ); {{#ct|# Dog.can('bark'); $fido.can('bark');}} ---- Perl 6 {{#ci|vs.}} 其他語言 ---- {{#c|外語}} 程式庫 ☼ ---- {{#c|use jsan:DOM;}} ---- use jsan:DOM; {{#c|use perl5:DBI;}} ---- use jsan:DOM; use perl5:DBI; {{#c|use parrot:SDL;}} ---- Perl 5 {{#c|超甜語法}} 造成執行環境肥大… ---- …Perl 6 {{#c|代糖編譯}} 讓程式輕快敏捷 ---- {{#c|空想}} 五年 ☹ ---- 開發工具 {{#c|Manipulexity}} 不足 {{#x|☣}} ---- {{#c|Pugs}} 曾是… ---- {{#c|☑}} ---- {{#date|Feb 1}} 收到 TaPL 實作{{#c|習題}}… ---- {{#date|Feb 6}} 初版{{#c|解譯器}}釋出 (1|2)+(3|4) ➥ (4|5|6) ---- {{#date|Feb 16}} {{#c|命令式}}操作 say \"Hello, world\" ---- {{#date|Feb 23}} {{#c|Test.pm}} is(1+1, 2, 'add') ---- {{#date|Mar 19}} PCRE {{#c|正規表示式}} s:P5:g/5/6/; ---- {{#date|Apr 26}} {{#c|BEGIN}} 區塊 use CGI; ---- {{#date|May 8}} {{#c|svnbot.p6}} r2851 | iblech++ ---- {{#date|May 5}} 內嵌 {{#c|Parrot}} AddHandler mod_pugs ---- {{#date|May 25}} Perl 6 {{#c|Prelude.pm}} sub sprintf ($fmt, *@args) ---- {{#date|May 29}} 內嵌 {{#c|Perl5}} use perl5:DBI; ---- {{#date|Jun 2}} {{#c|evalbot.p6}} [#perl6] ?eval 1+1 ---- {{#date|Jun 24}} Perl6 → {{#c|PIL}} → Parrot make smoke-pir ---- {{#date|Jul 14}} PIL → {{#c|Perl5}} make smoke-perl5 ---- {{#date|Jul 17}} PIL → {{#c|JavaScript}} make smoke-js ---- {{#date|Aug 1}} 類型物件模型 {{#c|自足表示}} class Class is Object; ---- {{#date|Aug 3}} {{#c|Kontent}} Wiki use perl5:DBI; ---- {{#date|Sep 29}} {{#c|統合}}運行後端界面 pugs -B Perl5 -e … ---- {{#date|Oct 9}} Haskell {{#c|Cabal}} 程式庫 libPugs.a ---- {{#date|Nov 2nd}} {{#c|Runtime API}}草案 Perl6::ObjectSpace ---- {{#date|Nov 3}} S17: {{#c|平行處理}}草案 sub f is atomic { … } ---- {{#date|Nov 4}} S22: {{#c|套件管理}}草案 p5-Foo-1.0-cpan+KANE.jib ---- {{#date|Nov 7}} {{#c|協同常式}}支援 coro { yield } ---- {{#date|Nov 23}} {{#c|\$Larry}} 初次送交更動 {{#q|(我們還在等 Guido ☺)}} ---- {{#date|Dec 1}} {{#c|6PAN}} 實作雛形 use perl5:JIB; ---- {{#date|Dec 10}} {{#c|物件空間}}解譯器 make pil ---- {{#date|Dec 20}} {{#c|區塊式匯入}} { use Module; … } ---- {{#date|Dec 31}} {{#c|Haskell}} 文法規則實作 Text.Parser.Rule Text.Parser.OpTable ---- {{#date|Jan 6}} {{#c|YAML}} 序列化 say $x.yaml; ---- {{#date|Jan 16}} {{#c|Parrot}} 區塊變數 parrotIsBrokenXXX = False ---- {{#date|Jan 28}} {{#c|多列}}互動界面 pugs> class Moose { ....> has $antler; ....> } pugs> my $moose = Moose.new; ---- {{#date|Feb 3}} 文法{{#c|自足解析}} grammar Perl6::Rx; ---- {{#date|Feb 16}} {{#c|YAML化}} Prelude.pm make {{#t|# 40分 → 8分}} ---- {{#date|Feb 22}} {{#c|\$Larry}} /join #perl6 <fglock> TimToady: 歡迎 <Juerd> 小心不要上癮 :) <TimToady> Juerd: 已經太遲了… ---- {{#date|Feb 23}} {{#c|YAML化}} Test.pm make smoke {{#t|# 100分 → 70分}} ---- {{#date|Feb 24}} {{#c|Perl6::Doc}} 文件樹 概要 / 教學 問答 / 昇級 / 規格 / 界面 ---- {{#date|Feb 25}} {{#c|源碼}}物件模型 $ast = q:code/ say 'hi' /; ---- {{#date|Mar 1}} {{#c|Perl5}} 文法規則實作 use Pugs::Compiler::Rule; ---- {{#date|Mar 11}} {{#c|Module::Compile}} use v6-pugs; ---- {{#date|Mar 14}} Perl 5 橋接 {{#c|PCRE}} use re::override-PCRE; ---- {{#date|Mar 15}} S26: {{#c|文件物件模型}}草案 =insert Copyright.kwid ---- {{#date|Mar 16}} Perl 6 編譯器{{#c|自足執行}}! lrep.p6 lrep.p6 ---- {{#date|Mar 24}} {{#c|文法範疇}}實作 Pugs::Grammar::Category ---- {{#date|Mar 30}} 變數{{#c|綁定}}實作 Data::Bind ---- {{#date|Apr 1}} {{#c|補捉}}取代{{#xs|參照}} $args = \\($x, opt => 1); ---- {{#date|Apr 3}} S15: {{#c|萬國碼文字處理}}草案 =encoding Big5 ---- {{#date|Apr 6}} 語言規格{{#c|同步}} Perl6::Spec::* ---- {{#date|Apr 8}} {{#c|OSDC.tw}} ---- {{#c|黑客松}} ♨ ---- {{#c|♨ 台北}} ---- ♨ 台北 {{#c|♨ 維也納}} ---- ♨ 台北 ♨ 維也納 {{#c|♨ 多倫多}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 {{#c|♨ 阿姆斯特丹}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 {{#c|♨ 愛赫特}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 {{#c|♨ 里斯摩}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 {{#c|♨ 雅貝山}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 {{#c|♨ 維也納²}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 ♨ 維也納² {{#c|♨ 東京}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 ♨ 維也納² ♨ 東京 {{#c|♨ 雷德蒙™?}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 ♨ 維也納² ♨ 東京 ♨ 雷德蒙™? {{#c|♨ 芝加哥?}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 ♨ 維也納² ♨ 東京 ♨ 雷德蒙™? ♨ 芝加哥? {{#c|♨ 帕薩迪納?}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 ♨ 維也納² ♨ 東京 ♨ 雷德蒙™? ♨ 芝加哥? ♨ 帕薩迪納? {{#c|♨ 康乃狄克?}} ---- ♨ 台北 ♨ 維也納 ♨ 多倫多 ♨ 阿姆斯特丹 ♨ 愛赫特 ♨ 里斯摩 ♨ 雅貝山 ♨ 維也納² ♨ 東京 ♨ 雷德蒙™? ♨ 芝加哥? ♨ 帕薩迪納? ♨ 康乃狄克? {{#c|…還有更多更多!}} ---- {{#c|Pugs}} 將是… ---- {{#c|‣‣}} ---- {{img src="/img/spacer.gif">
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.