Is Ruby a functional language?

前端 未结 12 1492
谎友^
谎友^ 2021-01-30 04:09

Wikipedia says Ruby is a functional language, but I\'m not convinced. Why or why not?

12条回答
  •  后悔当初
    2021-01-30 04:21

    Please, have a look at the beginning of the book: "A-Great-Ruby-eBook". It discusses the very specific topic you are asking. You can do different types of programming in Ruby. If you want to program like functionally, you can do it. If you want to program like imperatively, you can do it. It is a definition question how functional Ruby in the end is. Please, see the reply by the user camflan.

提交回复
热议问题