Using a lambda expression, we can make this more compact.
使用lambda表达式,我们可以把这段代码变得更紧凑一些。
The first line defines a lambda expression and binds it to the symbol total.
第一行代码定义了一个lambda表达式并将其和total符号绑定到一起。
Finally, the last expression applies the lambda expression to the list containing (101 102).
最终,最后一个表达式对包含 (101 102)的列表应用这个lambda 表达式。
He has a great diagram there showing the expression tree representation of a few lambda expressions.
他在那篇文章里用了非常好的图表来表现说明一些Lambda树的表达式树表示形式。
Perhaps the most common use of higher-order functions is the lambda expression, which is Lisp's version of a closure.
高阶函数的最常见用法或许是lambda表达式,这是闭包的lisp版。
He has a great example of how you can manipulate the expression trees and build custom conditions in your lambda expressions.
他举出了大量的例子告诉你如何巧妙地处理那些表达式树和编译你的带自定义条件的lambda表达式。
In his article on expression trees Ian Griffiths gives a great introduction to lambda expressions and their relation to expression trees.
IanGriffiths在他关于表达式树文章中,给出了一个非常不错的Lambda表达式介绍,以及Lambda与表达式树的关系。
Moq is a mocking library for .NET designed and developed to utilize .NET 3.5 features, e.g., Linq expression trees and lambda expressions.
Moq是利用诸如Linq表达式树和Lambda表达式等.NET 3.5的特性,为.NET设计和开发的Mocking库。
In this particular example, a method reference is a clearer expression of what we mean than a lambda expression, but the idea is the same.
在这个特殊的例子中,方法引用比lambda表达式更清晰地表达了我们的意图,但它们的概念是一样的。
For example, the following code declares a Comparator that compares strings by length and USES a lambda expression to define the Comparator:.
例如,下列的代码声明了一个Comparator,该表达式对字符串的长度进行比较,并使用一个lambda表达式来定义Comparator:。
An expression tree is a data representation of the lambda expression in a form that is easy for you to read and reason about the lambda expression in.
表达式树是lambda表达式的一种数据表示形式,它能使你更方便地读取和推断lambda表达式。
Item 2 is interesting, because it means that you can write a lambda expression into an expression tree, reason about it, etc, and then turn it into a callable delegate.
其中第二条是很有趣的,因为它意味着你能将一个lambda表达式复制进一个表达式树,推断它,并将它转换为一个可调用委托。
Here, the first lambda expression is the mapper (mapping each element to its size), and the second lambda expression is the reducer, which takes two sizes and adds them.
这里的第一个lambda表达是是一个mapper(映射器)(把每个元素和它的大小做映射),第二个lambda表达是是一个reducer(化简器),其取得两个大小数值并相加它们。
Function types are indeed the natural way to represent the type of a lambda expression, but unfortunately they interact badly with an existing language "feature" : erasure.
函数类型确实是表现lambda表达式类型的一种自然方法,但遗憾的是它们无法与现有语言功能“擦除(erasure)”很好地进行交换。
Because the lambda expression has the right argument and return types, the compiler verifies that it can be converted into a Comparator and generates the appropriate code for doing so.
因为lambda表达式拥有正确的参数和返回类型,编译器将证实可以把这些类型转换成Comparator,并生成完成此操作的相应代码。
If capture of mutable locals were allowed, the platform would need to extend the local variable's lifetime for as long as the dynamic lifetime of any lambda expression that captures it.
如果捕获可变局部变量是允许的行为的话,平台就需要扩展局部变量的生存期,使之与任何捕获该变量的lambda表达式的动态生存期一样长。
A lambda function is a function definition that you use to pass higher-order functions into Lisp functions. For example, the lambda expression in Listing 10 computes the sum of two integers.
lambda函数是用于将高阶函数传入lisp函数的函数定义。
Expression closures are a shorthand method of defining simple functions that mimics lambda notation.
表达式闭包是定义简单函数的一种便捷方式,用来模仿lambda符号。
In general, a lambda function is a function that takes any number of arguments and returns the value of a single expression.
一般来说,lambda函数接收任何数目的参数,并返回单个表达式的值。
In general, a lambda function is a function that takes any number of arguments and returns the value of a single expression.
一般来说,lambda函数接收任何数目的参数,并返回单个表达式的值。
应用推荐