In this article, I'll continue this tour of concepts by talking about first-class functions, optimizations, and closures.
在本文中,我将继续讨论这些概念,讲解一级函数、优化和闭包。
Specifically, functional programming languages must provide high-order and first-class functions, which this article defines.
特别地,函数式编程语言必须提供高阶和一流的函数,这是本文所定义的。
In functional programming, you have far fewer abstractions, but each one is generic (with specificity added via first-class functions).
在函数式编程中,您拥有更少的抽象,但是每个抽象都具有通用性(通过一等函数添加特性)。
You can see that once you become accustomed to thinking in terms of higher-order and first-class functions, you can reduce (pun intended) a lot of noise in your code.
您会看到,一旦您习惯了从高阶和一级函数的角度思考,您就能减少(一语双关)代码中无用的部分。
Functional languages rely on first-class functions (functions that can appear anywhere any other language construct can appear) as parameters and return values. Figure 3 illustrates this concept.
函数式语言依赖于一等函数(可在任何其他语言结构可能出现的地方出现的函数)作为参数和返回值。
Functional language constructs such as higher-order and first-class functions allow me to climb one more rung up the abstraction ladder and focus more on what the code does rather than how it does it.
函数语言结构,如高阶和一级函数,能让我对抽象的理解更进一步,让我更多地将精力放在代码能做什么而不是怎么做 上。
Functional language constructs such as higher-order and first-class functions allow me to climb one more rung up the abstraction ladder and focus more on what the code does rather than how it does it.
函数语言结构,如高阶和一级函数,能让我对抽象的理解更进一步,让我更多地将精力放在代码能做什么而不是怎么做 上。
应用推荐