什么是First-class citizen?

  In programming language design, a first-class citizen (also typeobjectentity, 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?的更多相关文章

  1. WordPress Citizen Space插件跨站请求伪造漏洞

    漏洞名称: WordPress Citizen Space插件跨站请求伪造漏洞 CNNVD编号: CNNVD-201307-463 发布时间: 2013-07-23 更新时间: 2013-07-23 ...

  2. First-class citizen

    In programming language design, a first-class citizen (also type, object, entity, or value) in a giv ...

  3. 【NLP】Python NLTK获取文本语料和词汇资源

    Python NLTK 获取文本语料和词汇资源 作者:白宁超 2016年11月7日13:15:24 摘要:NLTK是由宾夕法尼亚大学计算机和信息科学使用python语言实现的一种自然语言工具包,其收集 ...

  4. 用Kotlin语言重新编写Plaid APP:经验教训(II)

    原文标题:Converting Plaid to Kotlin: Lessons learned (Part 2) 原文链接:http://antonioleiva.com/plaid-kotlin- ...

  5. 【Codeforces163E】e-Government AC自动机fail树 + DFS序 + 树状数组

    E. e-Government time limit per test:1 second memory limit per test:256 megabytes input:standard inpu ...

  6. windows安装rabbitmq

    官网下载windows安装版本:http://www.rabbitmq.com/install-windows.html ,安装文件rabbitmq-server-3.6.5.exe 前提:安装erl ...

  7. 树莓派pppoe

    连接的网络是移动(铁通)的宽带,不同的宽带的dns需要修改. 1.首先安装pppoe包 apt-get install pppoe 2.然后,复制conf文件/etc/ppp/pppoe.conf: ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. HTML页面每次打开的时候都清除页面缓存

    解决办法为: (1) 用HTML标签设置HTTP头信息 <HEAD> <META    HTTP-EQUIV="Pragma" CONTENT="no- ...

  2. Linux上jdk安装及环境变量设置

    1.jdk下载和安装 (1)http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html下载需 ...

  3. iOS-----MFMessageCompose 和 MFMailComposeViewController的使用方法

    MFMessageCompose 和 MFMailComposeViewController的使用方法 使用MFMessageComposeViewCOntroller发短信 应用想自己提供界面让用户 ...

  4. ssh命令的使用

    ssh命令是用来远程登录服务器的,默认端口号为22. 常用的命令是: ssh   用户名@服务器地址 然后回车,输入登录服务器的密码 登录服务器后要进行上传下载文件,可以用scp命令,命令格式为: s ...

  5. BZOJ3298: [USACO 2011Open]cow checkers(佐威夫博弈)

    3298: [USACO 2011Open]cow checkers Time Limit: 10 Sec  Memory Limit: 128 MBSubmit: 195  Solved: 96[S ...

  6. MySQL 主从复制与读写分离

    1.MySQL主从复制入门 首先,我们看一个图: 影响MySQL-A数据库的操作,在数据库执行后,都会写入本地的日志系统A中. 假设,实时的将变化了的日志系统中的数据库事件操作,在MYSQL-A的33 ...

  7. Map排序(按key排序,按value排序)

    主要分两种,按键排序.按值排序. 而且,按key排序主要用于TreeMap,而按value排序则对于Map的子类们都适用. 一.按键排序 按Key排序主要用于TreeMap,可以实现按照Key值的大小 ...

  8. UVA-11478 Halum【二分】【差分约束】

    LINK1 LINK2 题目大意 给你一个n个点,m条边的有向图 有一种操作把所有到达这个点的边全部减小d,把所有从从这个点出发的边加上d 问最后是否可以让所有边的边权最小值最大 如果可以无限大,输出 ...

  9. 使用ndk-stack来查找崩溃

    logcat报错 Fatal signal 6 (SIGABRT) at 0x000025c9 (code=-6), thread 9703 (Thread-1277) 都是一些寄存器以及函数地址,真 ...

  10. Hystrix已经停止开发,官方推荐替代项目Resilience4j

    随着微服务的流行,熔断作为其中一项很重要的技术也广为人知.当微服务的运行质量低于某个临界值时,启动熔断机制,暂停微服务调用一段时间,以保障后端的微服务不会因为持续过负荷而宕机.本文介绍了新一代熔断器R ...