要了解闭包,首先需要了解匿名函数。
To understand closures, one first has to understand anonymous functions.
这会创建一个匿名函数并返回此函数。
匿名函数,您的函数是什么?
每个块都是作为一个匿名函数体来执行的。
Each chunk is executed as the body of an anonymous function.
匿名函数的参数是两项市场数据:股票代码和价格。
The anonymous function takes two market data as arguments: a ticker symbol and a price.
它是有益的申报PHP匿名函数外循环?
Is it beneficial to declare PHP anonymous functions outside a loop?
这些简单的匿名函数还执行另一个重要而微妙的任务。
Those simple anonymous functions also perform another important but subtle task.
在本例中,匿名函数为列表的每个元素加1。
In this case, the anonymous function adds 1 to every element of a list.
因为这些函数都没有名字,所以都是匿名函数。
Since these function do not have a name, they are anonymous.
上面的这个匿名函数很简单,它仅仅包装了一下broker。
This particular anonymous function is pretty simple: it wraps broker.
VisualBasic的迭代器,看上去更像一个匿名函数。
Visual Basic's Iterators, look more like an anonymous function.
这个to_function实现做了一件事——返回一个匿名函数。
This version of to_function does one thing - it returns an anonymous function.
然后将一个匿名函数(closure)传入到onevent属性。
You then pass in an anonymous function (closure) to the onEvent property.
其优点远远不止匿名函数、正则表达式支持、模式匹配这几样。
Anonymous functions, regular expression support and pattern matching are only the beginning.
在这个案例中您使用一个匿名内联函数,也称为一个闭包。
In this case, you used an anonymous inline function, also known as a closure.
匿名的函数可以这样使用。
字面函数也就是“匿名”函数。
字面函数也就是“匿名”函数。
应用推荐