Comments on: The Ultimate Guide to Blocks, Procs & Lambdas http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/ Ruby Programming Tutorials Wed, 09 Mar 2016 15:12:33 +0000 hourly 1 http://wordpress.org/?v=4.3.3 By: Robert http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/#comment-471 Mon, 08 Feb 2016 17:13:38 +0000 http://www.blackbytes.info/?p=2561#comment-471 Good article: clear and gives a good overview!

Some minor nitpicking:
– Blocks are anonymous functions.
– Usually the alternative delimiters to do…end are called “curly braces” or “curly brackets” – “brackets” are (…) if I’m not mistaken.
– There is another, older and thus potentially more compatible syntax to create lambdas: lambda {|arg| …} and lambda do |arg| … end

For those who want to dig into a few other aspects my old articles are still online:
http://blog.rubybestpractices.com/posts/rklemme/001-Using_blocks_for_Robustness.html
http://blog.rubybestpractices.com/posts/rklemme/002_Writing_Block_Methods.html

]]>
By: Sangam Gupta http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/#comment-470 Mon, 08 Feb 2016 07:38:26 +0000 http://www.blackbytes.info/?p=2561#comment-470 Thank you, I had the same assumption :)

]]>
By: Jesus Castello http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/#comment-469 Sun, 07 Feb 2016 17:54:26 +0000 http://www.blackbytes.info/?p=2561#comment-469 The lambda method on Kernel is the same as using the -> syntax for defining a lambda.

]]>
By: Sangam Gupta http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/#comment-468 Sun, 07 Feb 2016 17:50:28 +0000 http://www.blackbytes.info/?p=2561#comment-468 Very helpful, thank you. However there is one think confusing, I checked Kernel module and I see lambda method which is creating Proc object but you mentioned, lambda is a special object of Proc class. Your thoughts?

]]>
By: Jesus Castello http://www.blackbytes.info/2016/02/ruby-procs-and-lambdas/#comment-464 Wed, 03 Feb 2016 22:05:31 +0000 http://www.blackbytes.info/?p=2561#comment-464 Thanks for your comment :)

]]>