문제

I have a doubt on the lambda literal syntax corresponding to that (more classic) lambda syntax:

lambda { |foo| }

Is the following correct?

->(foo) {}

Thank you.

도움이 되었습니까?

해결책

That is correct. More information about that in the official documentation: http://www.ruby-doc.org/core-2.1.1/doc/syntax/literals_rdoc.html#label-Procs

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top