Any difference between First Class Function and High Order Function

前端 未结 6 1487
小鲜肉
小鲜肉 2021-01-29 17:23

I\'m wondering whether/what difference between First Class Function and High Order Function.

I read through those two wiki pages and they looks rather similar. If they

6条回答
  •  鱼传尺愫
    2021-01-29 18:01

    In addition to the previous answers, note that a language with first-class functions automatically enables the expression of higher-order functions (because you can pass functions as parameters like any other value).

    On the other hand, you can imagine languages that support higher-order functions, but do not make functions first-class (and where parameters that are functions are treated specially, and different from "ordinary" value parameters).

    So the presence of first-class functions (as a language feature) implies the presence of higher-order functions, but not the other way round.

提交回复
热议问题