4 ms·
I'm not sure how clear Strachey's definition can be, considering he never provided one. But his description of ALGOL procedures as second-class mentions that th
by djur 4y ago
I'm not sure how clear Strachey's definition can be, considering he never provided one. But his description of ALGOL procedures as second-class mentions that they can "never be represented by a variable or expression":
https://en.wikipedia.org/wiki/First-class_citizen#History https://en.wikipedia.org/wiki/First-class_citizen#History
In Ruby you can assign a function to a variable, pass it to a function as a parameter, return it as the result of a function, and test two function objects for equality. Ruby has first-class functions. If it didn't, you would easily be able to provide an example of a program using first-class functions that cannot be represented in Ruby.