Hello,
I wrote this post where I explain the subtle differences between procs &
lambdas, and how closures work in Ruby.
Please check it out:
Let me know what you think
Hello,
I wrote this post where I explain the subtle differences between procs &
lambdas, and how closures work in Ruby.
Please check it out:
Let me know what you think
Hey Jesus,
Nice summary! I'd agree with one of the other commenters that you may want to include Proc.new's behavior which is commonly used to lazily capture the block (let's you evaluate your guard clauses before capturing the block for example)
You may also want to give an example of forwarding a block to another method
If block_given?
other.do_stuff &Proc.new
else
other.do_stuff
end
Josh
Sent from my iPhone
On Feb 8, 2016, at 8:56 AM, Jesus Castello <matugm@gmail.com> wrote:
Hello,
I wrote this post where I explain the subtle differences between procs & lambdas, and how closures work in Ruby.Please check it out:
Ruby Blocks, Procs & Lambdas - The Ultimate Guide!
Let me know what you think
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Simple, clear, powerful !
I am a novice in Ruby and you're guide is very operative to understand
blocks.
From a noob, a big thanks !
Hello, Jesus!
Nice article. thanks for sharing!
May I suggest to include the info from the article Passing Blocks in Ruby
Without &block
<http://mudge.name/2011/01/26/passing-blocks-in-ruby-without-block.html>
as a good practice?
Also, the 1st comment to the article shows how to use only yield when
passing the block to methods.
<http://mudge.name/2011/01/26/passing-blocks-in-ruby-without-block.html>
--
Sincerely yours,
Aurel Branzeanu,
mailto: branzeanu.aurel@gmail.com
Skype: tvorogov
GSM Orange: +373 6 940-7700
GSM Moldcell: +373 7 940-7700
On Mon, Feb 8, 2016 at 3:56 PM, Jesus Castello <matugm@gmail.com> wrote:
Hello,
I wrote this post where I explain the subtle differences between procs &
lambdas, and how closures work in Ruby.Please check it out:
Ruby Blocks, Procs & Lambdas - The Ultimate Guide!
Let me know what you think
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
Nicely written and formatted! I could not spare you some minor
nitpicking (we're always trying to improve things, aren't we?).
Kind regards
robert
On Mon, Feb 8, 2016 at 2:56 PM, Jesus Castello <matugm@gmail.com> wrote:
Hello,
I wrote this post where I explain the subtle differences between procs &
lambdas, and how closures work in Ruby.Please check it out:
Ruby Blocks, Procs & Lambdas - The Ultimate Guide!
Let me know what you think
--
[guy, jim, charlie].each {|him| remember.him do |as, often| as.you_can
- without end}
http://blog.rubybestpractices.com/
Quiet awesome man, it was published in Ruby Weekly and I read it.
On Monday 08 February 2016 07:26 PM, Jesus Castello wrote:
Hello,
I wrote this post where I explain the subtle differences between procs & lambdas, and how closures work in Ruby.Please check it out:
Ruby Blocks, Procs & Lambdas - The Ultimate Guide!
Let me know what you think
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>
--
Karthikeyan A K
subscribe too.
8 ัะตะฒั. 2016 ะณ., ะฒ 18:28, Karthikeyan A K <karthikeyan@openmailbox.org> ะฝะฐะฟะธัะฐะป(ะฐ):
Quiet awesome man, it was published in Ruby Weekly and I read it.
On Monday 08 February 2016 07:26 PM, Jesus Castello wrote:
Hello,
I wrote this post where I explain the subtle differences between procs & lambdas, and how closures work in Ruby.Please check it out:
Ruby Blocks, Procs & Lambdas - The Ultimate Guide!
Let me know what you think
Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe> <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>--
Karthikeyan A KUnsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk>