Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Gotanda.pm #1
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Mihyaeru
June 11, 2014
Programming
190
1
Share
Gotanda.pm #1
Python使いから見たPerl @ Gotanda.pm #1
Mihyaeru
June 11, 2014
More Decks by Mihyaeru
See All by Mihyaeru
会計 freee バックエンドの今後 / freee backend api
mihyaeru21
8
26k
Railsで実装されている機能のマイクロサービスへの切り離し / split to microservices from rails
mihyaeru21
1
860
WebエンジニアのためのMySQLデータ構造基礎(再) / mysql data structure for web developer 2
mihyaeru21
0
320
WebエンジニアのためのMySQLデータ構造基礎 / mysql data structure for web developer
mihyaeru21
1
710
WebエンジニアのためのMySQL入門 / learning mysql for web developer
mihyaeru21
7
2.7k
入門ReactiveX / about ReactiveX
mihyaeru21
3
490
RxSwiftと愉快な仲間たち / RxSwift with Units
mihyaeru21
4
2.8k
RxSwiftでTwitterの ライブラリを作ってる話 / RxTwift
mihyaeru21
4
770
CrystalでTwitter botを作ってみた / Create a Twitter bot in Crystal
mihyaeru21
0
1.3k
Other Decks in Programming
See All in Programming
Go_College_最終発表資料__外部公開用_.pdf
xe_pc23
0
190
安いハードウェアでVulkan
fadis
1
960
YJITとZJITにはイカなる違いがあるのか?
nakiym
0
200
Kubernetes上でAgentを動かすための最新動向と押さえるべき概念まとめ
sotamaki0421
3
480
飯MCP
yusukebe
0
500
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
190
Xdebug と IDE による デバッグ実行の仕組みを見る / Exploring-How-Debugging-Works-with-Xdebug-and-an-IDE
shin1x1
0
360
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
150
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.3k
年間50登壇、単著出版、雑誌寄稿、Podcast出演、YouTube、CM、カンファレンス主催……全部やってみたので面白さ等を比較してみよう / I’ve tried them all, so let’s compare how interesting they are.
nrslib
4
770
PHP でエミュレータを自作して Ubuntu を動かそう
m3m0r7
PRO
2
180
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
840
Featured
See All Featured
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
170
Writing Fast Ruby
sferik
630
63k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
97
Practical Orchestrator
shlominoach
191
11k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.8k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
1.9k
A Tale of Four Properties
chriscoyier
163
24k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
1.8k
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.6k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.6k
Chasing Engaging Ingredients in Design
codingconduct
0
170
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
Transcript
1ZUIPO͍͔Βݟͨ1FSM (PUBOEBQN !NJIZBFSV
ࣗݾհ w ϛώϟΤϧ!NJIZBFSV w 1ZUIPO 0CKFDUJWF$ śƂŠƃٙ 1FSM w
ΏͱΓ7JNNFS w ζϰΟζμʔઓಆһ
Α͘--ͬͯҰׅΓʹ͞ΕΔ͠ 1ZUIPOΘ͔Ε༨༟Ͱ͠ΐ
ͭ1FSM
sub say_hello { my $name = shift; ! print "Hello,
$name\n"; }
͋ΕͬʁҾʁ TIJGUͬͯͳΜͶΜ
sub sum_numbers { my $sum; for (@_) { $sum +=
$_; } ! return $sum; }
Μͬʁ
$_ @_
@_ͱ͔$_ͱ͔Ͳ͔͜ΒདྷͨΜ ͳΜ͡Ό͍͜ΓΌʔʂ
࠷ॳʹࢥͬͨෆຬ w มͳه߸ଟͯ͘ҙຯෆ໌ w ίϯςΩετʁʁʁ w ຖճNZͬͯॻ͘ͷ໘͍͘͞ w ਅِΣʜʜ w
ϦϑΝϨϯεपΓ͕Θ͔Γʹ͍͘ w ҾϦετͲ͜ʂʁ ʜଞʹ͔͚͋ͬͨͩͲΕͨ͆
มͳه߸ଟͯ͘ҙຯෆ໌ $_ @_ 1ZUIPOͰ͜ΜͳʹढจΊ͍ͨมग़ͯ͜ͳ͔ͬͨʂ $! $@ ͨͿΜʜ $. $/
͜Μ͖ͯ͢ͱʁʁʁ @a = (0, 1, 2) Ϧετ ίϯςΩετ 0, 1,
2 εΧϥʔ ίϯςΩετ 3 ཁૉ͕Γ͔ͨͬͨΒlen()ͱ͔໌ࣔతʹॻ͖͍ͨ ॴʹΑͬͯҙຯ͢Δͱ͜Ζ͕ҧ͏ʜʜͩͱʜʜ
NZࢯ w --ͬͯݴΘΕΔ͘Β͍ͩ͠ɺϥΠτʹॻ͖͍ͨ w 1ZUIPOͰम০ࢠͳ͠ͰϩʔΧϧม
ਅِΣʜʜ w ਅِΛද͢໌֬ͳ͕ͭͳ͍ w 5SVF 'BMTFཉ͍ͬ͢͠ w ίϯςΩετ૬·ͬͯѻ͍͕͍͠
ϦϑΝϨϯε w ࠷ॳɺ ͱ<>ಉͩ͡ͱࢥ͍ͬͯͨ w εΧϥʔมͳͷʹྻʂ w 1ZUIPOͰྻͱݴͬͨΒ͜Ε͚ͩ @a =
(0, 1, 2); $ref = \@a; $ref = [0, 1, 2]; a = [0, 1, 2]
ͳΜͰҾϦετͳ͍ͷ w !@Λड͚ͱΔ͚Ͳ͍ํࣗ༝͗͢ w 1ZUIPOͩͱؔͷσϑΥϧτΛઃఆͰ͖Δ͠ ΩʔϫʔυͰݺͿ͜ͱग़དྷΔʂ my ($a, $b) =
@_; my $a = shift; my %args = @_;
ͪͳΈʹ w σϑΥϧτΛͬͨݺͼग़͠ w ී௨ͷݺͼग़͠ w Ωʔϫʔυݺͼग़͠ def hello(name =
'mihyaeru'): print 'Hello, %s' % name ! hello() hello('dareka') hello(name = 'anata')
ෆຬΛ๊͖ͭͭ ϲ݄͕ܦա
࠷ॳʹࢥͬͨෆຬ w มͳه߸ଟͯ͘ҙຯෆ໌ w ίϯςΩετʁʁʁ w ຖճNZͬͯॻ͘ͷ໘͍͘͞ w ਅِΣʜʜ w
ϦϑΝϨϯεपΓ͕Θ͔Γʹ͍͘ w ҾϦετͲ͜ʂʁ
࠷ॳʹࢥͬͨෆຬࠓ w มͳه߸ଟͯ͘ҙຯෆ໌ w ίϯςΩετʁʁʁ w ຖճNZͬͯॻ͘ͷ໘͍͘͞ w ਅِΣʜʜ w
ϦϑΝϨϯεपΓ͕Θ͔Γʹ͍͘ w ҾϦετͲ͜ʂʁ ׳ΕΕා͘ͳ͍ʂ ׳ΕΕʢ͈́ ॻ͍ͨํ͕҆৺ײ͋Δ ਅِΣʜʜ Ҿʹ໊લͳ͘୯ͳΔϦετ ະͩʹͬ͘͠Γ͜ͳ͍
ෆຬ͔Γݴͬͯ ΞϨͳͷͰ
ؾʹೖ͍ͬͯΔͱ͜Ζ w ແ໊͕͍͍ؔ͢ w NBQͱ͔HSFQͷײ͕͖͡ w ϝιουݺͼग़࣌͠ͷୈҰҾʹTFMG͕ೖͬͯ͘Δ
ແ໊͕͍͍ؔ͢ w 1ZUIPOʹMBNCEBͱ͍͏ແ໊ؔΛ࡞Δه๏ΞϦ w ࣜΛ͔ͭ͠ೖΕΒΕͳ͍͔Βจͷॲཧμϝ hoge_call(sub { # do #
something # hoge }); def temp(): # do # something # hoge ! hoge_call(temp) 1FSM 1ZUIPO
NBQͱ͔HSFQ͕ྑ͍ײ͡ ҾΛح͚ͩʹߜΓࠐΜͰɺɺɺ ͨ͠ͷྻʹ͢Δɺɺɺ తͳॲཧ my @squared_odds = map { $_
* $_ } grep { $_ % 2 == 1 } @_;
1ZUIPOͩͱ [x * x for x in nums if x
% 2 == 1]
1ZUIPOͩͱ [x * x for x in nums if x
% 2 == 1] NBQʹ૬ HSFQʹ૬
Ϧετแදه [x * x for x in X if x
% 2 == 1] {x2 | x ∈ X, x % 2 = 1} ֶͷू߹ʹ͓͚Δแతදه͕ݩʹͳ͍ͬͯΔ
ϝιουͷTFMG 1ZUIPOΛኲኵͱͤͯۙ͞ײ͋Γ sub method { my ($self, $hoge) = @_;
} def method(self, hoge): pass
ಥ͚ͩͲ ͦΜͳ͜ΜͳͰ
·ͱΊ w 1FSM͍࢝Ίͯϲ݄ͷਓͷײ w ֖Λ͚͋ͯΈΔͱṖ͍ͱ͜Ζ͕ଟʑ w ͋Δఔ׳ΕͰͳΜͱ͔ͳΔʂ w 1FSMා͔͚ͬͨͲࠓͰ͖ͳͱ͜Ζ͋Δʂʂ