高阶函数
- 网络Higher-order Function;higher order functions
-
temperature高阶函数返回current的值,而current又可以有hot或cold函数。
The temperature higher-order function returns the value of current , which has either the hot or cold function .
-
PHP的arrayfilter是函数式编程语言中高阶函数的一个例子。
PHP 's array_filter is an example of what is know in functional programming as a higher-order function .
-
参数传递给高阶函数,然后作为参数传递给closure的use关键字,仍保持其值
Arguments passed to higher-order functions , and then passed on as arguments to a closure 's use keyword also retain their values
-
但JavaScript的实力并不仅限于高阶函数。
But the strengths of JavaScript don 't begin and end with higher-order functions .
-
在Java语言中,不直接支持高阶函数,所以这个功能是这两种语言之间的重大差异。
Higher-order functions are not supported directly in the Java language , so this functionality represents a unique difference in the two languages .
-
C开发人员很容易将此概念看作是函数指针功能,但JavaScript的高阶函数的功能更为强大。
C developers think of this concept as a function pointer , but JavaScript 's notion of higher-order functions is much more powerful .
-
闭包经常会在函数语言和框架中用作可移动执行机制,会作为转换代码传递给高阶函数,如map()。
Closures are used quite often as a portable execution mechanism in functional languages and frameworks , passed to higher-order functions such as map () as the transformation code .
-
当然,Java并不真的具有高阶函数,但如果严格限制特定的数据结构与类型,就可以编写很好的模拟。
Of course , Java doesn 't really have higher-order functions , but you can write a good analog if you restrict it to a particular data structure and type .
-
这些由列表构建的简单指令构成了递归、高阶函数,甚至是闭包和continuation之类高级抽象的基础。
These simple list-building instructions form the foundation of recursions , higher-order functions , and even higher-order abstractions like closures and continuations .
-
在Lisp中,由于函数和列表没有任何区别,高阶函数也就非常简单。
In Lisp , higher-order functions are trivial because functions are no different from any other kind of list .
-
高阶函数的最常见用法或许是lambda表达式,这是闭包的Lisp版。
Perhaps the most common use of higher-order functions is the lambda expression , which is Lisp 's version of a closure .
-
在Groovy中,在大括号{}内的所有内容都是代码块,代码块可作为参数来传递类似于高阶函数。
In Groovy , anything inside curly braces { } is a code block , and code blocks can be passed as parameters , mimicking a higher-order function .
-
鉴于这种思想,用支持Monad程序设计的高阶函数语言Haskell实现了一个Monad的自动生成系统。
In this paper an automatic Monad generator from other style of Monad is designed and implemented in Haskell .
-
在适应了lambdas和closures以后,您可能会发现,通过编写您自己的高阶函数您已经减少了代码并创建了更多的可读与可用代码。
After becoming comfortable with lambdas and closures , you may find yourself reducing code and creating more readable and reusable code by writing your own higher-order functions .
-
方程式语言中扩充高阶函数
An Extension to Equational Programming Language with High Order Functions
-
高阶函数提供比面向对象概念更高层次的抽象。
Higher-order functions offer a higher level of abstraction than object-oriented concepts .
-
关于高阶函数的更多内容,请参见参考资料。
See Resources for more about higher order functions .
-
通过高阶函数,这很容易做到。
With a higher-order function , it 's easy .
-
高阶函数式语言的部分求值器
The partial evaluator for high order functional language
-
高阶函数能实现所有这些要求。
Higher-order functions do all of these things .
-
在函数式语言中,可利用高阶函数来处理。
In a functional language , this would be handled via a higher-order function instead .
-
高阶函数可以将其他函数作为参数或者返回结果。
Higher-order functions can either take other functions as arguments or return them as results .
-
适合采用高阶函数来解决的问题不仅限于函数式语言中。
The problems amenable to solution by using higher-order functions aren 't unique to functional languages .
-
通过将使用函数和方法作为高阶函数进行开发,可使应用程序更加健壮。
By developing utility functions and methods as higher-order functions , you make your applications more robust .
-
这是函数语言使用的“高阶函数”概念的扩展。
This is an extension of the " higher order functions " concept that functional programmers toss around .
-
函数式编程通过提取通用的功能部分来实现代码重用,可通过高阶函数进行定制。
Functional programming achieves code reuse by abstracting out generic pieces of machinery , customizable via higher-order functions .
-
一个高阶函数可以将函数作为参数,也可以返回一个函数。
Higher-order functions . A high-order function is one that either takes functions as arguments or returns a function .
-
首先,具有高阶函数意味着您可以假设如何将语言部分组合成一个整体。
First , having higher-order functions means that you can make assumptions about how language parts will fit together .
-
后续内容还会对闭包与高阶函数做一些有趣的对比。
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 .