In the proc, the return "123"
is bubbling up and returning from the outer function, func_one
. Therefore the second return statement is never encountered.
In the lambda, the return "123"
is returning only from the lambda. You're not setting an variable to the return value of the lambda (when you do lambda_new.call
, so the value is basically just thrown out. Then, the return "456"
is called and returns from the function. If, instead of returning "456"
, you returned lambda_new.call
, the return value of func_two
would be "123"
.