Hacker News new | ask | show | jobs
by jonnytran 1264 days ago
> Ruby not having first-class functions

This is simply false. Ruby has first-class functions.

Not only that, it has blocks, which few other languages have. Ruby optimizes for the common use-case of a method that takes a single callback/piece of code, and I miss it in most other languages, including Python.

In Python, the "with" statement is super special. But in Ruby, it's just a method that takes a block. And any method can take a block, not just one per class.

https://yehudakatz.com/2010/02/07/the-building-blocks-of-rub...

1 comments

Ruby does not have first-class functions. Why do you insist on sounding so sure about something you are so wrong about?

https://blog.appsignal.com/2018/09/04/ruby-magic-closures-in...