Earlier quoted context omitted.
I have no idea what they mean by Ruby not having first-class functions. Of course it does. It's a fundamental feature of the language.
No it does not. Ruby has first-class procs. They are not the same thing. It's a fundamental flaw of the language. It's in the Wikipedia page. https://en.wikipedia.org/wiki/First-class_function "The identifier of a regular "function" in Ruby (which is really a method) cannot be used as a value or passed. It must first be retrieved into a Method or Proc object to be used as first-class data. The syntax for calling such…
Procs are functions (at least, they are functionally equivalent to Python functions—as pure OO languages, in both Ruby and Python first-class callable entities are richer than classic functions, even when counting closures as a kind functions and not a separate thing that includes a function, because they can carry metadata besides the environment of a closure.)
> It's in the Wikipedia page.
The Wikipedia page is wrong in that conclusion.
> The identifier of a regular "function" in Ruby (which is really a method) cannot be used as a value or passed
A method is a very different thing than a function. But, on a deeper level, I think it is also a mistake to call the thing it is referring the identifier for the method, its just syntax sugar for a symbol passed to a #send call, which, if send isn't overwritten on the sender (which it probably shouldn’t be, overriding send is a good way to cause chaos) will result in the method being called, unless some other method has priority.
> The syntax for calling such a function object differs from calling regular methods
The syntax is different only inna waybthat reflects thebdifferent behavior. Calling #call on a Proc or Method object (again, assuming a sane world where the object’s send method isn’t overidden) does dynamic method lookup on the :call name in the Method or Proc, and its syntax is exactly normal method-call syntax for that behavior (unless you use the shortcut syntax of “.()” for “.call()”, but that's just syntax sugar).
Using normal method call syntax does dynamic lookup on the method name provided in the call on the receiver object identified in the call.
That is, Ruby methods are first class, but what it is a convenient shortcut to think of as “method call syntax” in Ruby is not really method call syntax, it is syntax for a message send that will (by overridable default) result in calling a method with that name if it exists in the ancestor chain of classes for the object, so it is inaccurate to view the “method call” syntax excluding any parameters as “the identifier for the method”.