什么是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 ...
随机推荐
- centos7 搭建svn服务器&客户端的访问&备份迁移
当今用于版本控制的软件程序主要的有svn和git,其它软件咱不熟悉,今天记录下搭建svn服务器和svn客户端使用: 使用环境:虚拟机为centos7系统,svn服务器安装在centos7系统平台上,s ...
- 关于React setState的实现原理(一)
前言 首先在学习react的时候就对setSate的实现有比较浓厚的兴趣,那么对于下边的代码,可以快速回答吗? class Root extends React.Component { constru ...
- c++的c风格字符串函数的实现
要注意使用断言判断传入的字符串非空. #include <cassert> //求字符串长度 size_t StrLen(const char *str) { assert(str != ...
- VirtualBox只能生成32位虚拟机
/************************************************************************* * VirtualBox只能生成32位虚拟机 * ...
- selenium-java,暂停功能
暂停/开始应用程序 public class Common_method { public void kill_chromedriver(){ Runtime runtime=Runtime.getR ...
- 《DSP using MATLAB》Problem 2.5
2.代码: %% ------------------------------------------------------------------------ %% Output Info abo ...
- python基于协程的网络库gevent、eventlet
python网络库也有了基于协程的实现,比较著名的是 gevent.eventlet 它两之间的关系可以参照 Comparing gevent to eventlet, 本文主要简单介绍一下event ...
- graphql-yoga interface && union 使用
接口就是一个约定,方便数据的约定,union 可以实现数据类型的共享,减少代码量 基本项目 参考 https://github.com/rongfengliang/graphql-yoga-doc ...
- (原创)AP6212蓝牙模块在am335x控制板上的应用
主控板wifi模块调通后接着调试蓝牙,经过两周的摸索,终于把蓝牙应用基本建立起来,下面记录下大概流程. 1.硬件管脚设置 static void uart4_init(int evm_id, int ...
- 【小技能整理】mac vim开启语法高亮
步骤1: cp /usr/share/vim/vimrc ~/.vimrc 先复制一份vim配置模板到个人目录下 注:redhat 改成 cp /etc/vimrc ~/.vimrc 步骤2: vi ...