lambda表达式是函数式编程中的匿名函数语法规范。

In computer programming, an anonymous function (function literallambda abstraction, or lambda expression) is a function definition that is not bound to an identifier. Anonymous functions are often:[1]

  • arguments being passed to higher-order functions, or
  • used for constructing the result of a higher-order function that needs to return a function.

If the function is only used once, or a limited number of times, an anonymous function may be syntactically lighter than using a named function. Anonymous functions are ubiquitous in functional programming languages and other languages with first-class functions, where they fulfill the same role for the function type as literals do for other data types.

Anonymous functions originate in the work of Alonzo Church in his invention of the lambda calculus in 1936, before electronic computers, in which all functions are anonymous.[2]

Anonymous functions can be used for containing functionality that need not be named and possibly for short-term use. Some notable examples include closures and currying.

Use of anonymous functions is a matter of style. Using them is never the only way to solve a problem; each anonymous function could instead be defined as a named function and called by name. Some programmers use anonymous functions to encapsulate specific, non-reusable code without littering the code with a lot of little one-line normal functions.

https://en.wikipedia.org/wiki/Anonymous_function#C.23_lambda_expressions

最新文章

  1. UrlRewritingNet伪静态的使用方法与解决方案(URL重写)
  2. 分析移动端APP的网络请求抓包
  3. Oracle Hints详解
  4. OneAPM:打造云时代的应用性能管控平台
  5. sed 详解
  6. js为表格添加行和列
  7. 使用hexdump 查看二进制文件
  8. LeetCode 709.To Lower Case
  9. LeetCode - Rectangle Overlap
  10. 【DB2】索引
  11. MySQL数据库----多表查询
  12. python linux 自动补全 tab.py
  13. Scratch3.0设计的插件系统(上篇)
  14. 使用 Windows 运行时中异步性来始终保持应用程序能够快速流畅地运行
  15. 如何在线制作gif图片?
  16. django-model之Q查询补充
  17. asp.net MVC 4.0 Controller回顾——ModelBinding实现过程
  18. (updated on Mar 1th)Programming Mobile Applications for Android Handheld Systems by Dr. Adam Porter
  19. QTextEdit/QPlainTextEdit添加文字超出视图后,滚动条自动移至最底部
  20. openxml in sql server

热门文章

  1. 构造函数和初始化表、this指针与常函数、析构函数、拷贝构造与拷贝赋值(day05)
  2. PHP利用Mysql锁解决高并发
  3. Git 基础教程 之 解决合并冲突
  4. (19)Spring Boot 添加JSP支持【从零开始学Spring Boot】
  5. elasticsearch Suggester实现搜索建议(八)
  6. rmq算法,利用倍增思想
  7. django orm多条件查询及except处理不存在记录的样码
  8. 【ACM】poj_2210_Metric Time_201308011933
  9. [bzoj2631]tree_LCT
  10. HDU 4507