Skip to content

Instantly share code, notes, and snippets.

View tauil's full-sized avatar
🛠️
I love building and customising things. From software to hardware.

Rafael Borgonovi Tauil tauil

🛠️
I love building and customising things. From software to hardware.
View GitHub Profile
@mislav
mislav / procs-vs-lambda.md
Last active March 26, 2021 18:34
Jim Weirich on the differences between procs and lambdas in Ruby

Jim Weirich:

This is how I explain it… Ruby has Procs and Lambdas. Procs are created with Proc.new { }, lambdas are created with lambda {} and ->() {}.

In Ruby 1.8, proc {} creates lambda, and Ruby 1.9 it creates procs (don't ask).

Lambdas use method semantics when handling parameters, procs use assignment semantics when handling parameters.

This means lambdas, like methods, will raise an ArgumentError when called with fewer arguments than they were defined with. Procs will simply assign nil to variables for arguments that were not passed in.

@rodrigopinto
rodrigopinto / grbc_horaextra_2012.beer
Created January 21, 2012 22:25
Samba enredo 2012 do G.R.B.C #horaextra
Hojeee é mais uma segunda-feira,
a patroa ta avisada,
não tenho hora pra voltar.
Vou pro bar com amigos,
Entre uma cerveja e outra,
não vejo a hora passar
Conversa nerd, filosófica ou afiada
o que importa é a cervejada