Frage

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.

War es hilfreich?

Lösung

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

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top