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
Mihyaeru
June 11, 2014
Programming
1
180
Gotanda.pm #1
Python使いから見たPerl @ Gotanda.pm #1
Mihyaeru
June 11, 2014
Tweet
Share
More Decks by Mihyaeru
See All by Mihyaeru
会計 freee バックエンドの今後 / freee backend api
mihyaeru21
8
25k
Railsで実装されている機能のマイクロサービスへの切り離し / split to microservices from rails
mihyaeru21
1
830
WebエンジニアのためのMySQLデータ構造基礎(再) / mysql data structure for web developer 2
mihyaeru21
0
300
WebエンジニアのためのMySQLデータ構造基礎 / mysql data structure for web developer
mihyaeru21
1
690
WebエンジニアのためのMySQL入門 / learning mysql for web developer
mihyaeru21
7
2.6k
入門ReactiveX / about ReactiveX
mihyaeru21
3
460
RxSwiftと愉快な仲間たち / RxSwift with Units
mihyaeru21
4
2.8k
RxSwiftでTwitterの ライブラリを作ってる話 / RxTwift
mihyaeru21
4
740
CrystalでTwitter botを作ってみた / Create a Twitter bot in Crystal
mihyaeru21
0
1.3k
Other Decks in Programming
See All in Programming
AI駆動開発カンファレンスAutumn2025 _AI駆動開発にはAI駆動品質保証
autifyhq
0
130
CSC509 Lecture 09
javiergs
PRO
0
290
Introducing RemoteCompose: break your UI out of the app sandbox.
camaelon
2
470
Kotlinで実装するCPU/GPU 「協調的」パフォーマンス管理
matuyuhi
0
290
When Dependencies Fail: Building Antifragile Applications in a Fragile World
selcukusta
0
120
Vueのバリデーション、結局どれを選べばいい? ― 自作バリデーションの限界と、脱却までの道のり ― / Which Vue Validation Library Should We Really Use? The Limits of Self-Made Validation and How I Finally Moved On
neginasu
3
1.8k
O Que É e Como Funciona o PHP-FPM?
marcelgsantos
0
250
マンガアプリViewerの大画面対応を考える
kk__777
0
460
React Nativeならぬ"Vue Native"が実現するかも?_新世代マルチプラットフォーム開発フレームワークのLynxとLynxのVue.js対応を追ってみよう_Vue Lynx
yut0naga1_fa
2
2k
One Enishi After Another
snoozer05
PRO
0
180
CSC509 Lecture 07
javiergs
PRO
0
260
CSC305 Lecture 13
javiergs
PRO
0
370
Featured
See All Featured
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.8k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Docker and Python
trallard
46
3.6k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6k
Into the Great Unknown - MozCon
thekraken
40
2.1k
Embracing the Ebb and Flow
colly
88
4.9k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
15k
Making the Leap to Tech Lead
cromwellryan
135
9.6k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
116
20k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Designing for Performance
lara
610
69k
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ා͔͚ͬͨͲࠓͰ͖ͳͱ͜Ζ͋Δʂʂ