Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Ruby Foundations Procs & Lambdas Working With Procs & Lambdas

Clarification on the language and flow of the example within this video?

The examples illustrating how proc and lambda returns differ and how their flow varies really confused me here;

Video states, "while if you use a lambda it will return only from the lambda," ....so one expects the return to be what is inside the lambda's argument ("returning from lambda inside method") but instead goes on to exit the lambda and return the method's return.

This is super confusing and should be updated for viewers.

I saw something that speaks to this but the response didn't seem definitive: https://teamtreehouse.com/forum/procs-and-lambdas

Further clarification anybody? Maybe some details into what is actually happening?

Thanks!

I'm glad I wasn't the only one who thought the language sounded backwards. Thanks for bringing it up!

3 Answers

Hi, Jean Bae , this article provides a detailed yet concise look at Understanding Ruby Blocks, Procs and Lambdas

+1 to Jean

Also, a very helpful explanation using puts https://teamtreehouse.com/forum/returning-from-a-proc-vs-lambda