Is Ruby a functional language?
问题 Wikipedia says Ruby is a functional language, but I'm not convinced. Why or why not? 回答1: I most definitely think you can use functional style in Ruby. One of the most critical aspects to be able to program in a functional style is if the language supports higher order functions... which Ruby does. That said, it's easy to program in Ruby in a non-functional style as well. Another key aspect of functional style is to not have state, and have real mathematical functions that always return the