Herunterladen für Windows Premium
Sonderaktion: Entdecken Sie Premium
-50% dauerhafter auf alle Abonnements
Werbung
nested function

Übersetzung für "nested function" im Chinesisch

Wir konnten diesen Eintrag nicht finden. Es werden ungefähre Ergebnisse angezeigt. Prüfen Sie die Rechtschreibung oder schlagen Sie vor, diesen Begriff dem Wörterbuch hinzuzufügen.
嵌套函数
Here is an example of a nested function from some real code
下面是真实代码中的嵌套函数的例子:
A "nested function" is a function defined inside another function.
"嵌套函数"是在另一个函数内部定义的函数。
In other words, var variables are defined from the beginning of the function, no matter where the definition is (assuming that the definition is not in the nested function).
换言之,var 声明的变量会在函数开头被定义,与它在代码中定义的位置无关(这里不考虑定义在嵌套函数中的情况)。
Technically, the loop is more effective. These two variants do the same, but the loop does not spend resources for nested function calls.
从技术上讲,循环更有效。这两种解法的做了同样的事儿,但循环不会为嵌套函数调用消耗资源。
If f would have been a nested function we would still have run into the same problem and this is the reason they are not supported in C.
即使f 是个嵌套函数,仍然要面对同样问题,这也是C语言不支持嵌套函数的理由。 [6]
Sometimes it's ok to write.then directly, because the nested function has access to the outer scope (here the most nested callback has access to all variables scriptX), but that's an exception rather than a rule.
有时直接写.then 是没问题的,因为嵌套函数可以访问外部作用域(这里大多数嵌套回调函数有权利访问所有的变量 scriptX),但这是一个例外而不算是规则。
(Nested functions are not supported for GNU C++.) The nested function's name is local to the block where it is defined.
(GNU C++ 不支持嵌套函数)嵌套函数的名字域是它被定义的那个程序块。
But if there's a nested function that is still reachable after the end of f, then it has [[Environment]] property that references the outer lexical environment, so it's also reachable and alive
…但是如果有一个嵌套函数在 f 结束后仍可达,那么它的 [[Environment]] 引用会继续保持着外部词法环境存在:
It doesn't matter whether the function is created using Function Declaration or Function Expression. All functions get the [[Environment]] property that references the Lexical Environment in which they were made. So our new tiny nested function gets it as well.
不管是使用函数声明或是函数表达式创建的函数都没关系,所有的函数都有 [[Environment]] 属性,该属性引用着所创建的词法环境。新的嵌套函数同样也拥有这个属性。
Please note how memory management works here. Although makeCounter() call finished some time ago, its Lexical Environment was retained in memory, because there's a nested function with [[Environment]] referencing it.
请注意这里的内存管理工作机制。虽然 makeCounter() 执行已经结束,但它的词法环境仍保存在内存中,因为这里仍然有一个嵌套函数的 [[Environment]] 在引用着它。
There are three Algol features used in this program that can be difficult to implement properly in a compiler: Nested function definitions: Since B is being defined in the local context of A, the body of B has access to symbols that are local to A - most notably k which it modifies, but also x1, x2, x3, x4, and x5.
在这个程序中,有三个ALGOL特性是编译器中比较难正确实现的: 嵌套函数定义 :由于B 是在A 的函数体中实现,B 的函数体就有权限访问A 的局部变量 - 例如最明显的k 值,以及x1,x2,x3,x4,x5 。
There is a limitation when passing parameters with modifier. All parameters in different level of methods should keep the same. For example, if we want to expand the code above to a general"+N" adder, one way is by nested function like this
最后,要注意的是参数的修饰是具有传递限制的,就是说对于跨越层级的调用,我们需要保证同一参数的修饰是统一的。举个例子,比如我们想扩展一下上面的方法,实现一个可以累加任意数字的 +N器 的话,可以写成这样:
The "Step" command goes into it and pauses the execution at its first line, while "Step over" executes the nested function call invisibly, skipping the function internals.
"下一步(Step)"命令进入函数内部并在第一行暂停执行,而"跨步(Step over)"在无形中执行函数调用,跳过了函数的内部。
Für diese Bedeutung wurden keine Ergebnisse gefunden.
Zu Premium wechseln, um Millionen von Übersetzungsbeispielen freizuschalten, unbegrenzt Vokabeln zu speichern und zu lernen – ganz ohne Werbung.

Synonyme und ähnliche Wörter für „nested function“ auf Englisch

Wort und Redewendung des Tages
Bild des Tages
witch: person who practices witchcraft
Entdecke das Wort
Werbung

Ergebnisse: 15. Genau: 15. Bearbeitungszeit: 10 ms.