3 ms·
Sigh. Yes, I am aware of the technicalities you describe. I thought my point was clear without my needing to be pedantically accurate. In many languages (eve
by jonahx 3y ago
Sigh. Yes, I am aware of the technicalities you describe. I thought my point was clear without my needing to be pedantically accurate.
In many languages (even in JS!) you can just map a function point-free, rather than having to introduce a variable just because syntax demands it, or worry about which syntax to use depending on if the "function" you're calling is a method on the object being mapped or something else. It's all noise.
> you can do that without an expllcit block already, by using the Object#method method, which returns a Proc that is equivalent to calling the method:
> users.map &method(:do_something)
Again, I am aware, and the ugliness of that solution proves the point I was trying to make -- it is even worse than the block syntax with a variable.
- dragonwriter 3y ago> In many languages (even in JS!) you can just map a function point-free, Yes, in many languages, "functions" are a thing that exists. In Ruby, there is no such thing as a function. The concept does not exist. Which is why it is bizarre to talk about what you can and can't do with "functions" in Ruby, and to call kinds of different not-function things (including symbols, of all things) "functions" in that discussion. Its just applying language that makes no sense.