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 trialJean Bae
2,276 PointsClarification 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!
3 Answers
William Li
Courses Plus Student 26,868 PointsHi, Jean Bae , this article provides a detailed yet concise look at Understanding Ruby Blocks, Procs and Lambdas
Kameron Johnson
11,932 Points+1 to Jean
Unsubscribed User
3,309 PointsAlso, a very helpful explanation using puts https://teamtreehouse.com/forum/returning-from-a-proc-vs-lambda
Justin Foss
Courses Plus Student 8,808 PointsJustin Foss
Courses Plus Student 8,808 PointsI'm glad I wasn't the only one who thought the language sounded backwards. Thanks for bringing it up!