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
Church Numerals
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
HORINOUCHI Masato
March 26, 2018
Programming
55
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Church Numerals
社内LT大会 0x64物語Reboot #0x0C Lambda 資料
HORINOUCHI Masato
March 26, 2018
More Decks by HORINOUCHI Masato
See All by HORINOUCHI Masato
balenaCloud
thermes
0
110
CPS & CTO
thermes
0
250
FM synthesis
thermes
0
40
A440
thermes
0
67
Inside mml2wav.rb
thermes
0
93
Scheme Interpreter in Ruby
thermes
0
74
Clock / Timer
thermes
0
180
Hash Tree
thermes
0
83
POSIX Threads
thermes
0
59
Other Decks in Programming
See All in Programming
What's New in Android 2026
veronikapj
0
260
進化を続けるGo toolsの現在地 / The Current State of Ever-Evolving Go Tools
hond0413
0
240
ルールを書いて終わらせないハーネスエンジニアリング
yug1224
5
1.9k
Built Our Own Background Agent at LayerX
layerx
PRO
10
5.7k
in-process GraphQL のすすめ #ginzajs
izumin5210
4
1.3k
SlackアプリとLambdaの 連携を構築した話
pawn_4_s
1
120
プロポーザルを書いてもらう
pvcresin
0
550
AI Engineeringは、AIプロダクトだけのものか? 〜AIがソフトウェアを作る時代の新しい当たり前〜 / No AI in your product. AI Engineering in your development.
rkaga
4
460
FDEが実現するAI駆動経営の現在地
gonta
2
290
<title><a id="</title>君はこのHTMLをパースできるか"></a></title> #雑LT_study
pizzacat83
0
150
ソフトウェアエンジニアにとっての生成AI - 特性を知って使い倒す / generative ai for software enginner
kishida
5
1.9k
関東Kaggler会_NVIDIA_Nemotron_コンペ_振り返り
rick_ds
0
650
Featured
See All Featured
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
68
56k
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
340
Abbi's Birthday
coloredviolet
3
9.4k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
420
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
300
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Fireside Chat
paigeccino
42
4k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
37
6.6k
jQuery: Nuts, Bolts and Bling
dougneiner
66
8.5k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
480
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2k
Transcript
Church Numerals 2018/03/26 0x64 Tales Reboot #0x0C Lambda Livesense Inc.
OB HORINOUCHI Masato
νϟʔνͱ • ࣗવΛϥϜμࣜͰදݱ͢Δํ๏ͷͻͱͭ • ؔͰΛද͍ͯ͠Δ
ϥϜμܭࢉ • ϥϜμܭࢉͰ 2 + 3 = 5 Λܭࢉͯ͠ΈΑ͏
νϟʔνͷఆٛ 0 := λf x. x 1 := λf x.
f x 2 := λf x. f (f x) 3 := λf x. f (f (f x)) ↓RubyͰॻ͘ͱ… cn_0 = lambda { |f, x| x } cn_1 = lambda { |f, x| f.call(x) } cn_2 = lambda { |f, x| f.call(f.call(x)) } cn_3 = lambda { |f, x| f.call(f.call(f.call(x))) }
ޙଓ SUCC := λn f x. f (n f x)
↓RubyͰॻ͘ͱ… succ = lambda { |n| lambda { |f, x| f.call(n.call(f, x)) } }
Ճࢉ PLUS := λm n f x. m f (n
f x) ↓RubyͰॻ͘ͱ… plus = lambda { |m, n| lambda { |f, x| m.call(f, (n.call(f, x))) } }
Rubyͷੈքͱม • ͩʔͬͱઆ໌͖͚ͯͨ͠Ͳɺ্هͰఆٛͨؔ͠νϟʔν (lambda)ͳͷͰ… • RubyωΠςΟϒͷදݱʹม͍ͯ͋͛ͨ͠ɻ def cn_to_i(cn) cn.call(lambda {
|x| x + 1 }, 0) end
σϞ
Next Step ܭࢉػϓϩάϥϜͷߏͱղऍ (௨শ SICP) MITͷೖίʔεͰ͏ܭࢉػՊֶͷ༏ ΕͨڭՊॻ ϋϧɾΤΠϒϧιϯ, δΣϦ ʔɾαεϚϯ,
δϡϦʔɾαεϚϯڞஶ( ాӳҰ༁)ʮܭࢉػϓϩάϥϜͷߏͱղ ऍ ୈೋ൛ʯ(ϐΞιϯɾΤσϡέʔγϣϯ 2000). දࢴͷຐज़ࢣΏ͑ʹͦ͏͍ΘΕ Δ. LISP/Schemeੈքͷయͷͻͱͭ.
·ͱΊ • SICP ಡॻձͰνϟʔνΛֶΜͩͱ͖ɺࢀՃऀશһṖͷײಈɻ • ΈΜͳ SICP ಡΜͰͶɻ • Ruby
ͷ Lambda .call ͠ͳ͍ͱ͍͚ͳ͍ͷͰɺಡΈॻ͖͠ ਏ͍…ɻ
͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠