Higher-order functions offer a higher level of abstraction than object-oriented concepts.
高阶函数提供比面向对象概念更高层次的抽象。
The problems amenable to solution by using higher-order functions aren't unique to functional languages.
适合采用高阶函数来解决的问题不仅限于函数式语言中。
If you've ever used closures or higher-order functions, you might have a better understanding of the code in Listing 10.
如果使用过高阶函数或闭包,那么可能更容易理解清单10中的代码。
I'll also circle back to some interesting comparisons between closures and higher-order functions in a later installment.
后续内容还会对闭包与高阶函数做一些有趣的对比。
So based on the dynamic typing and higher-order functions, you can introduce arbitrary behavior to your classes at any time.
所以,基于动态类型和高阶函数,您可以在任何时候向类中引入任意的行为。
Functional programming achieves code reuse by abstracting out generic pieces of machinery, customizable via higher-order functions.
函数式编程通过提取通用的功能部分来实现代码重用,可通过高阶函数进行定制。
Using a function as a function argument, or returning a function as a value, elevates this abstraction into the realm of higher-order functions.
将函数用作函数的参数,或将函数作为值返回,这些概念属于高阶函数的领域。
Chapter 8 is the heart of the book, implementing functions that operate on other functions (higher-order functions, possibly the reason for the title of the book).
第8章是本书的核心,它实现了对其他函数进行操作的函数(高阶函数,这可能就是本书得名的由来)。
These simple list-building instructions form the foundation of recursions, higher-order functions, and even higher-order abstractions like closures and continuations.
这些由列表构建的简单指令构成了递归、高阶函数,甚至是闭包和continuation之类高级抽象的基础。
With the availability of higher-order functions, the entire problem of determining if a number is perfect or not collapses to a couple of lines of code in Groovy, as shown in Listing 7.
由于高阶函数的可用性,确定数字是否完全的整个问题在Groovy中只需几行代码即可完成,如清单7所示。
With the availability of higher-order functions, the entire problem of determining if a number is perfect or not collapses to a couple of lines of code in Groovy, as shown in Listing 7.
由于高阶函数的可用性,确定数字是否完全的整个问题在Groovy中只需几行代码即可完成,如清单7所示。
应用推荐