闭包是具有闭合作用域的匿名函数。
Go为声明匿名函数提供了简单的语法。
Go provides a simple syntax for declaring anonymous functions.
通过用匿名函数来替换正式函数定义,您可简化代码。
By replacing formal function definitions with anonymous functions, you simplify code.
好奇的读者会想是什么使仿函数不同于匿名函数或闭包呢?
Curious readers will be wondering what makes a functor different from an anonymous function or closure.
例如,有一个用在匿名函数里头的ParallelFor语法。
For example, there is a Parallel For syntax that relies on anonymous functions.
afterFinish的值是一个匿名函数,在效果完成时被调用。
The value of afterFinish is an anonymous function that is invoked when the effect is done.
匿名函数通常通过分配到一个代理变量,来在其他函数的上下文中定义。
An anonymous function is defined within the context of another function, usually by assigning it to a delegate variable.
请注意将您传递到extend函数的映射从关键字映射到匿名函数。
Notice that the map you pass to the extend function maps from keywords to anonymous functions.
按照设计,闭包是匿名函数,这意味着它们不显示在反射api中。
By design, closures are anonymous functions, which means they do not appear in the reflection API.
YUI分析器提供了一种调用匿名函数的机制,使得它们可以被分析。
The YUI Profiler provides a mechanism for instrumenting anonymous functions, allowing them to be profiled.
这个表达式实际上是一个“匿名函数”的函数体,在Scala中称为字面函数。
This expression is actually the body of an "anonymous function", called a function literal in Scala.
不过对于VB用户来说,在不支持多行匿名函数的语言里,新语法看起来没那么清爽。
Unfortunately for VB users, it isn't nearly as clean in languages that don't support multi-line anonymous functions.
如果函数是匿名函数,则在function和左括号之间应有一个空格。
If a function literal is anonymous, there should be one space between the word function and the left parenthesis.
解决办法是,把你的变量放在一个匿名函数内部,定义完之后立即调用它。
The workaround is to encapsulate your variables in an anonymous function and call that function immediately after you define it.
此匿名函数现在被命名了,使大多数分析器的分析结果显示出有意义的内容。
The anonymous function is now named, providing most profilers with something meaningful to display along with the profile results.
它是一个匿名函数,times方法被传递到该函数,函数的结果是打印出静态语句。
It's an anonymous function that's passed into The Times method and prints a static sentence. This code is tighter and simpler than the alternative with a for loop, shown in Listing 2.
它构造一种抽象形式的Erlang表达式,并返回一个匿名函数,让它以后再动态地求解。
It builds an Erlang expression in abstract form and returns an anonymous function which can dynamically evaluate it later.
在这种情况下,当任意客户端发送数据给服务器时,就会调用这个匿名函数并将数据传入函数中。
In this case, when any client sends data to server, this anonymous function is called and the data is passed into the function.
和XAML不同的是,既可以把一个函数作为参数传入,也可以通过一个内联的匿名函数来定义转换器。
Unlike XAML, you have the option of either passing in a function or defining the converter inline as an anonymous function.
但是,不要让calculus的复杂性妨碍了您对lambdas的使用:它们也只不过是匿名函数。
But don't let the complexity of calculus dissuade you from using lambdas: They are really nothing more than anonymous functions. The following function definition, for example, is a lambda.
如果还觉得定义一个属性也很麻烦,你可以在一个表达式中,直接定义并执行一个匿名函数。
If defining even a single property is too much, you can define and invoke an anonymous function in a single expression.
与支持函数编程的其他语言不同,Ceylon不支持匿名函数 (直接出现在表达式中的未命名函数)。
Unlike other languages with functional support, Ceylon doesn't support anonymous functions (unnamed functions that appear directly in expressions).
由于它是在另外一个函数当中实现了一个匿名函数,人们就能够做一些前置检查和在迭代器创建之后进行计算。
Since it is implemented as an anonymous function within another function, one could do some preliminary checks and calculations before creating the iterator.
就是说,closure是个匿名函数,在其创建时,将来自创建该函数的代码范围内得变量值附加到它本身。
That is, a closure is an anonymous function that, when created, attaches to itself the value of variables from the scope of the code that created the function.
lambda函数(或者通常所谓的“匿名函数”)是可以随时定义的简单抛弃型函数,并且通常都与变量绑定。
Lambda functions (or "anonymous functions," as they are often referred to) are simply throwaway functions that can be defined at any time and are typically bound to a variable.
在这里,在执行each函数调用的匿名函数期间,我们希望能够修改organizer的pixmap字段。
In this case, we want to be able to alter the Organizer's pixMap field during the execution of the anonymous function being called by the each function.
一个Groovy闭包是一个匿名函数,它可访问包含它的范围,可随意被重复调用,并可将其当作数据到处传递。
A Groovy Closure is an anonymous function that can access its enclosing scope, can be called repeatedly at will, and be passed around as it were data.
到目前为止看到的例子中,匿名函数都只不过是一个没有名称的函数,它被就地求值,基于定义它的位置来决定它的上下文。
From the examples so far, you can see that an anonymous function is simply a function, without an name, that is evaluated in place and determines its context based on where it is defined.
对于为W3C和Microsoft事件模型定义的匿名函数,都可以将FadingTooltip对象的指针封闭在其中。
You could have enclosed a pointer to your FadingTooltip object in the anonymous functions you defined for the W3C and Microsoft event models as well.
对于为W3C和Microsoft事件模型定义的匿名函数,都可以将FadingTooltip对象的指针封闭在其中。
You could have enclosed a pointer to your FadingTooltip object in the anonymous functions you defined for the W3C and Microsoft event models as well.
应用推荐