这些闭包名称反映了它们的含义。
用闭包进行定制会有一些惊人之处。
Customization with closures can take you in some surprising places.
可以使用匿名的内部类来实现闭包。
Primarily, you can use anonymous inner classes to implement closures.
这种闭包也可以包含间接关联路径。
闭包是函数语言的共有特征之一。
Closures are one of the common features of functional languages.
JEST资源:可定制的持久化闭包。
可以用闭包来表述模型架构上的完整性。
You can use closures to make statements about the architectural integrity of your models.
清单2:不含闭包的循环。
一流的方法和函数(闭包)
Kevin介绍的另外一个概念是闭包。
他的最终建议也是只在真正必要时使用闭包。
His final recommendations are also along the lines of only using closures when truly necessary.
闭包是具有闭合作用域的匿名函数。
您可以根据需要通过闭包构建自己的抽象概念。
You can build in your own abstractions as needed, with closures.
闭包可以通过接口传递给静态方法和构造函数。
Closures can be passed as interface to static methods, constructors.
让我们在此基础上了解如何在php中使用闭包。
清单8是清单7的一个简化版,其中使用了闭包。
Listing 8 shows a simplification of Listing 7, using a closure.
我们可以通过将闭包定义为静态闭包禁用此行为。
We can disable this behavior by defining the closure to be static.
这些仅仅是众多使用闭包进行迭代的方法中的两种。
These are just two more of the many ways that you can use closures to iterate.
这个示例中所使用的生成递归闭包的方法有些冗长。
The way of making recursive closures used in this example is a bit tedious.
后续内容还会对闭包与高阶函数做一些有趣的对比。
I'll also circle back to some interesting comparisons between closures and higher-order functions in a later installment.
但是,同样有价值的是Groovy对闭包的使用。
这样,新创建域类时它们就有适当的字段和事件闭包。
That way every new domain class created already has the fields and event closures in place.
一些人认为闭包带给编程语言的额外复杂性并不划算。
Some believe that the extra complexity that closures will add to the language is not worth it.
闭包本质上是一个函数和其引用的变量的统一定义。
Closures are functions that reference variables from the scope enclosing the function definition.
闭包的语法发生了变化,但是大多数变化只与参数有关。
The syntax for closures has changed, but mostly only with regard to parameters.
闭包能够大大简化代码的另一个地方是泛化算法的使用。
Another place where closures offer an opportunity to dramatically simplify code is in the use of generic algorithms.
闭包按照所期望的类型(目标类型)自动地被构造。
Closures are constructed automatically depending on the expected type (target typing).
在本例中,闭包的生命周期实际上比定义闭包的方法长。
In this case, the closure's lifetime will actually be longer than the method that has defined them.
在本例中,闭包的生命周期实际上比定义闭包的方法长。
In this case, the closure's lifetime will actually be longer than the method that has defined them.
应用推荐