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
Lambdas and Pops - Jan Hettich
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Las Vegas Ruby Group
June 18, 2014
0
92
Lambdas and Pops - Jan Hettich
Las Vegas Ruby Group
June 18, 2014
Tweet
Share
More Decks by Las Vegas Ruby Group
See All by Las Vegas Ruby Group
Ruby ISO Standard - David Grayson
lvrug
0
150
Windows Automation - Howard Feldman
lvrug
0
91
Separating Your Application from Rails - Brian Hughes
lvrug
0
140
SWIG and Ruby - David Grayson
lvrug
0
89
Practical Object-Oriented Design in Ruby - Charles Jackson
lvrug
3
140
The Hamster Gem - Ryan Mulligan
lvrug
1
100
Varnish+Redis - Russ Smith
lvrug
1
120
Making Good Use of Fonts - Russ Smith
lvrug
1
98
Writing Files - Ryan Mulligan
lvrug
0
76
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
31
6.6k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
Producing Creativity
orderedlist
PRO
348
40k
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
310
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
BBQ
matthewcrist
89
10k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Principles of Awesome APIs and How to Build Them.
keavy
128
17k
Believing is Seeing
oripsolob
1
56
エンジニアに許された特別な時間の終わり
watany
106
230k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
62
Transcript
λ's and POP's Jan Hettich LVRUG 5/21/2014
Two kinds of Proc “plain old proc” lambda closure? yes
yes class Proc Proc .lambda? false true semantics yield invocation similar to block method
Creation • “Plain old procs” • Kernel.proc {|args| code} •
Proc.new {|args| code} • Lambdas • Kernel.lambda {|args| code} • literal: ->(args) {code} • Method.to_proc
call syntax • direct call – foo.call(args) – foo[args] –
foo.(args) • block-style call – iterator args, &foo
call semantics • yield semantics (blocks, pops) • similar to
parallel assignment • return => lexically enclosing method • invocation semantics (methods, lambdas) • number of arguments must match • “diminutive return”
Let's look at some code • A Digression on Method
• Argument Passing • return statement • Using next • New behavior in Ruby 2.1.0