在 英语 中使用 An anonymous function 的示例及其翻译为 中文
{-}
-
Political
-
Ecclesiastic
-
Programming
The do x syntax creates an anonymous function with argument x and passes it as the first argument to map.
An anonymous function cannot be a direct call to print because lambda requires an expression.
An anonymous function is like an inline function in traditional programming languages, defined within a single MATLAB statement.
Any function that is defined as a function expression is technically an anonymous function since there is no definitive way to reference it.
The sayName() property is assigned an anonymous function and has all the same characteristics as the ECMAScript 5 sayName() function. .
An anonymous function cannot be a direct call to print because lambda requires an expression.
You can also assign an anonymous function to be the value of a variable, for example.
However, an anonymous function(which can be created by a function expression or the Function constructor) does not have a name.
An anonymous function looks very much like a regular function declaration, except that its name is omitted.
Lua treats any independent chunk as the body of an anonymous function.
Usage 2: You can also use function to create an anonymous function and return a reference to it.
Here, the function doesn't have a name, so we call it an anonymous function.
If we just want to run a bit of code, such as the above, we can use an anonymous function.
It is an expression, and its value is called an anonymous function.
This way, we don't even need to give the function a name, which is why this is called an anonymous function.
In the example offered by Somasegar, you need to assign an anonymous function to Office. initialize.
Even more convenient is to use the lambda keyword to define an anonymous function, similar to how an anonymous inner class would work in Java.
When an anonymous function requires recursion, as in this example, we must first declare a variable, and then assign the anonymous function to that variable.
When an anonymous function requires recursion, as in this example, we must first declare a variable, and then assign the anonymous function to that variable.
It's an anonymous function.