DEV Community

Discussion on: Why I still love Ruby

Collapse
 
strzibny profile image
Josef Strzibny • Edited

functions are both first class concepts in Ruby

Actually Ruby does not have functions at all. There are all methods.

Thread Thread
 
swiknaba profile image
Lud

They are all objects! :D

Thread Thread
 
kwstannard profile image
Kelly Stannard

Procs are functions.

Thread Thread
 
strzibny profile image
Josef Strzibny

From the Ruby doc: "Proc objects are blocks of code that have been bound to a set of local variables. Once bound, the code may be called in different contexts and still access those variables."

I can also recommend a book patshaughnessy.net/ruby-under-a-mi... that goes greatly to the implementation as well.