What do you call the -> operator in Ruby?
In Ruby Programming Language ("Methods, Procs, Lambdas, and Closures"), a lambda defined using ->
is called lambda literal.
succ = ->(x){ x+1 }succ.call(2)
The code is equivalent to the following one.
succ = lambda { |x| x + 1 }succ.call(2)
Informally, I have heard it being called stabby lambda or stabby literal.
Lambda rocket
I got that from this article.But first a google search forruby lambda shorthandhttp://ruby-journal.com/becareful-with-space-in-lambda-hash-rocket-syntax-between-ruby-1-dot-9-and-2-dot-0/