如果碰巧该闭包函数跟某个事件绑定,那么就必须要解绑定。
If you happened to attach the closure to an event, then you would have to detach it from that event.
从外部环境中导入的变量是在闭包函数定义的use子句中指定的。
Variables to be imported from the outside environment are specified in the use clause of the closure function definition.
闭包函数和lambda函数绝对不是新出现的概念;它们均来自函数编程领域。
The concepts of closures and lambda functions are definitely not new ones; they both come from the functional programming world.
默认情况下,它们是由值传递的,意味着如果要更新传递到闭包函数定义内的值,则不更新外部值。
By default, they are passed by value, meaning that if we would update the value passed within the closure function definition, it would not update the outside value.
这个文本搜索包和它的相关函数被称为文本搜索引擎,它是专门设计用来执行文本数据的快速检索和自动索引。
This text search package and its associated functions, referred to as the text search engine, is specifically designed to perform fast retrieval and automatic indexing of text data.
新的搜索函数包(or g . apache . lucene . search . function)允许开发人员在计算文档相关度使用某个字段的实际内容。
The new search function package (org.apache.lucene.search.function) allows developers to use the actual content of a field in scoring a document.
在以后的版本中,我将可能会把这个函数移到Gnosis包内的其他地方。
I will probably move the function elsewhere within the Gnosis package for later releases.
在Oracle10g 中可以使用包对过程或函数进行分组。
Packages can be used in Oracle 10g to group a set of procedures or functions.
要构建一个使用闭包的函数,只需要使用yield关键字来调用该闭包。
To build a function that USES a closure, you simply use the yield keyword to invoke the closure.
闭包类似于lambda函数,但是在与定义闭包的外部环境中的变量进行交互方面更加智能。
Closures are like lambda functions, but smarter in the sense that they have the ability to interact with variables from the outside environment of where the closure is defined.
所有内容(报告、分析、文件夹、包等等)以及许多函数和系统功能都可以有相关联的权限(例如对Studios的访问权)。
All content (reports, analysis, folders, packages, and so on) and a wide range of functions and capabilities of systems can have permissions attached to them (for example, access to Studios).
首先,创建在资源包中查找fieldName的el函数。
First, you create an el function that looks up a fieldName in the resource bundle.
调用函数tcp _ output,将SY n包输出到网络。
The function tcp_output is called, which outputs the SYN packet onto the network.
一个闭包封闭了这些引用,所以函数调用可以安全的引用这些变量,即使它们已经超出了函数的作用域。
A closure "closes around" these references, so the function invocation can safely refer to the variables even when the variables have gone out of scope!
这种情况下返回的函数对象就是一个闭包,其中封装了一些日志代码和最初的函数调用所需要的数据。
In this case the returned function object is a closure which encapsulates some logging code and the data needed to call the original function.
这个闭合的作用域是将闭包同调用函数和定义它的代码联系起来的纽带。
This closed scope is the communication that ties the closure to the calling function and the code that defines it.
闭包是函数语言的共有特征之一。
Closures are one of the common features of functional languages.
注释是可以添加到代码中的修饰符,可以用于包声明、类型声明、构造函数、方法、字段、参数和变量。
Annotations are modifiers you can add to your code and apply to package declarations, type declarations, constructors, methods, fields, parameters, and variables.
把闭包应用于函数模式是令人兴奋的,一旦这么做了之后,再把它们应用于面向对象设计模式,就不是什么大事情了。
Applying closures to functional patterns is exciting, and once you've done that, it's not too big a stretch to apply them to object-oriented design patterns.
清单3包含有这个函数,它尝试打开数据库(如果尚未打开的话)并查询数据库。
Listing 3 contains this function, which attempts to open the database (if not already opened) and query the database.
闭包本质上是一个函数和其引用的变量的统一定义。
Closures are functions that reference variables from the scope enclosing the function definition.
好奇的读者会想是什么使仿函数不同于匿名函数或闭包呢?
Curious readers will be wondering what makes a functor different from an anonymous function or closure.
闭包是具有闭合作用域的匿名函数。
方法有两种:创建一个工具包来封装所有本机函数;或者将本机函数直接包含到应用程序中。
This could be done in one of two ways. You could either create a toolkit that encapsulates all the native functions, or directly include native functions into an application.
以上演示了为什么闭包体现了函数思想:让运行时管理状态。
This illustrates why the use of closures exemplifies functional thinking: allow the runtime to manage state.
在本文中,我将继续讨论这些概念,讲解一级函数、优化和闭包。
In this article, I'll continue this tour of concepts by talking about first-class functions, optimizations, and closures.
确认代码中的包名、类名以及类构造函数名都已改为与项目名一致。
Be sure to change the package, class, and constructor names in the Java code to match the project name.
如果使用过高阶函数或闭包,那么可能更容易理解清单10中的代码。
If you've ever used closures or higher-order functions, you might have a better understanding of the code in Listing 10.
它在此上下文中用作宏,通过闭包调用函数方法将在定义它的上下文中执行函数调用。
It ACTS like a macro in this context, where calling the method of function via the closure makes the function call in the context of where it's defined.
它在此上下文中用作宏,通过闭包调用函数方法将在定义它的上下文中执行函数调用。
It ACTS like a macro in this context, where calling the method of function via the closure makes the function call in the context of where it's defined.
应用推荐