This is a set of lecture notes that developed out of courses on the lambda calculus that I taught at the University of Ottawa in 2001 and at Dalhousie University in 2007. Topics covered in these notes include the untyped lambda calculus, the Church-
Lambda 表达式(=>) “Lambda 表达式”是一个匿名函数,它可以包含表达式和语句,并且可用于创建委托或表达式目录树类型。 所有 Lambda 表达式都使用 Lambda 运算符 =>,该运算符读为“goes to”。该 Lambda 运算符的左边是输入参数(如果有),右边包含表达式或语句块。Lambda 表达式 x => x * x 读作“x goes to x times x”。可以将此表达式分配给委托类型,如下所示:
1、 查询Student表中的所有记录的Sname、Ssex和Class列。 SQL语句:select sname,ssex,class from student Linq语句: from s in Students select new { s.SNAME, s.SSEX, s.CLASS } Lambda表达式: Students.Select( s => new { SNAME = s.SNAME,SSEX = s.SSEX,CLASS = s.CLASS })