什么是First-class citizen?
【什么是First-class citizen?】
In programming language design, a first-class citizen (also type, object, entity, or value) in a given programming language is an entity which supports all the operations generally available to other entities. These operations typically include being passed as an argument, returned from a function, and assigned to a variable.
第一类公民(first-class citizen),是支持所有operation的entity。这些operation包括作为函数参数、函数返回值、直接赋值给变量。
【First and second class objects】
A real number may appear in an expression or be assigned to a variable, and either may appear as an actual parameter in a procedure call. A procedure, on the other hand, may only appear in another procedure call either as the operator (the most common case) or as one of the actual parameters. There are no other expressions involving procedures or whose results are procedures. Thus in a sense procedures in Algol are second class citizens—they always have to appear in person and can never be represented by a variable or expression (except in the case of a formal parameter)。
实数可以出现在一个表达式、赋给一个变量、作为函数调用的参数。但方法,只能在一个方法调用过程中作为operator、作为其他方法的实际的参数。方法的应用范围不如实数大,所以称为二等公民。
参考:https://en.wikipedia.org/wiki/First-class_citizen#cite_note-1
什么是First-class citizen?的更多相关文章
- WordPress Citizen Space插件跨站请求伪造漏洞
漏洞名称: WordPress Citizen Space插件跨站请求伪造漏洞 CNNVD编号: CNNVD-201307-463 发布时间: 2013-07-23 更新时间: 2013-07-23 ...
- First-class citizen
In programming language design, a first-class citizen (also type, object, entity, or value) in a giv ...
- 【NLP】Python NLTK获取文本语料和词汇资源
Python NLTK 获取文本语料和词汇资源 作者:白宁超 2016年11月7日13:15:24 摘要:NLTK是由宾夕法尼亚大学计算机和信息科学使用python语言实现的一种自然语言工具包,其收集 ...
- 用Kotlin语言重新编写Plaid APP:经验教训(II)
原文标题:Converting Plaid to Kotlin: Lessons learned (Part 2) 原文链接:http://antonioleiva.com/plaid-kotlin- ...
- 【Codeforces163E】e-Government AC自动机fail树 + DFS序 + 树状数组
E. e-Government time limit per test:1 second memory limit per test:256 megabytes input:standard inpu ...
- windows安装rabbitmq
官网下载windows安装版本:http://www.rabbitmq.com/install-windows.html ,安装文件rabbitmq-server-3.6.5.exe 前提:安装erl ...
- 树莓派pppoe
连接的网络是移动(铁通)的宽带,不同的宽带的dns需要修改. 1.首先安装pppoe包 apt-get install pppoe 2.然后,复制conf文件/etc/ppp/pppoe.conf: ...
- Lesson 1 A private conversation
Text Last week I went to the theatre. I had a very good seat. The play was very intersting. I did no ...
- Functional Programming without Lambda - Part 1 Functional Composition
Functions in Java Prior to the introduction of Lambda Expressions feature in version 8, Java had lon ...
随机推荐
- javascript递归导致的堆栈溢出
function foo() {foo(); //setTimeout(foo, 0); } foo() 原因是每次执行代码时,都会分配一定尺寸的栈空间(Windows系统中为1M),每次方法调用 ...
- 【解决】Android 2.x 不支持overflow、position:fixed解决方案【转】
Android 2.x和IOS5以下都不支持overflow:auto属性(position:fixed也不支持). 移动端浏览器兼容性和PC端相比,有过之而无不及.操作系统版本及各式浏览器和各式的屏 ...
- Jenkins的2个问题
最近CI服务器从老版本的hudson升级为jenkins,遇到了2个问题,记录一下: 1.升级为jenkins后,junit report里面显示的test case数量为原来的两倍,每个test c ...
- [批处理]批量提取MKV资源
最初是下了部没字幕的动漫,是720P MKV格式的,当时没注意,下完了以后才发现是没字幕的 后来去射手上找没有,百度了半天也没有 最后只能求救与已经下了这部动漫是MKV格式且是内挂字幕的人来帮忙 最后 ...
- [转]设置银行卡密码的个人bug
国庆前去某银行新办了张银行卡,办卡的时候修改了默认的密码.国庆期间要网上购物,结果密码输入3次都错误,所以银行卡被锁定了,只能等国庆后银行上班再去解锁. 国庆结束后跑去银行重置了密码,流程是这样的:1 ...
- linux查看端口对应的程序及pid
linux中查看特定端口对应的进程以及进程的pid可以使用下面指令: lsof -i:port_number 杀死进程的指令是: kill -s 9 pid
- L203 词汇题
Conditions for the growth of this plant are optimum in early summer.we will live as free people, not ...
- js enter键激发事件
document.onkeydown = function (e) { if (!e) e = window.event; if ((e.keyCode | ...
- 历史上的重大软件BUG启示录第9篇---微软的硬件尝试
(图片来源于网络) 2001年苹果公司发布第一代iPod,它的推出在当时引起了轰动,它拥有大容量存储空间和全新的操作方式,并且还非常漂亮(在当时看来),因此在市场上大受欢迎,苹果公司也因此赚的盆满钵满 ...
- URL 生成带文字二维码
<!DOCTYPE html> <html> <head> <title></title> <meta charset="u ...