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, modified, and assigned to a variable.[1]

The simplest scalar data types, such as integer and floating-point numbers, are nearly always first-class.

In many older languages, arrays and strings are not first-class: they cannot be assigned as objects or passed as parameters to a subroutine. For example, neither Fortran IV nor C supports array assignment, and when they are passed as parameters, only the position of their first element is actually passed—their size is lost. C appears to support assignment of array pointers, but in fact these are simply pointers to the array's first element, and again do not carry the array's size.

In most languages, data types are not first-class objects, though in some object-oriented languages, classes are first-class objects and used for metaclasses.

Few languages support continuations and GOTO-labels as objects at all, let alone as first-class objects.

Concept Description Languages
first-class function closures and anonymous functions SchemeMLHaskellF#ScalaSwiftPHPPerl 6JavaScript
first-class control continuations SchemeMLF#
first-class type   CoqIdris
first-class data type   Generic Haskell. C++11
first-class polymorphism impredicative polymorphism  
first-class message dynamic messages (method calls) Smalltalk,[7] Objective-C[7]
first-class class metaclass SmalltalkObjective-CRubyPython
  proof object[8] CoqAgda

First-class citizen的更多相关文章

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

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

  2. 什么是First-class citizen?

    [什么是First-class citizen?] In programming language design, a first-class citizen (also type, object,  ...

  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. nginx 与 Windows 错误

    设置根目录 root "D:/www/app"; proxy_pass 反向代理 404 location php 模块添加 fastcgi_split_path_info ^(( ...

  2. solarwind之network Atlas

    1.  连接密码为空,连接到Orion     2.  连接后如下图   3.  直接拖动节点即可进行绘制地图   4.  查看它的相关属性          

  3. Block formatting context & Inline formatting context(BFC&IFC)的区别(转载)

    何为BFC与IFC bfc与ifc是针对页面正常流的两种环境,块级元素处于bfc环境中,行内元素处于ifc环境中. 元素是块级元素or行内元素由其display属性决定: block, table, ...

  4. ubantu上搭建hive环境

    上次我们在ubantu上安装了hadoop,那我们现在再进一步,开始我们的学习之旅--hive板块吧! 第一步:准备! 软件: I.一个搭建好的hadoop环境 II.hive的bin文件(前往apa ...

  5. Java中使用MD5加密的简单实现

    import java.math.BigInteger; import java.security.MessageDigest; import java.security.NoSuchAlgorith ...

  6. JS 将有父子关系的数组转换成树形结构数据

    将类似如下数据转换成树形的数据 [{ id: 1, name: '1', }, { id: 2, name: '1-1', parentId: 1 }, { id: 3, name: '1-1-1', ...

  7. 如何解决zabbix中自定义监控mysql因密码造成的 Warning

    1.--show-warnings=false 在指定mysql命令获取参数时,指定不获取 Warning.不过亲测这个方法不是很有效 例如: mysql -uroot -p123 --show-wa ...

  8. ThinkPHP 跨模块调用操作方法(A方法与R方法)

    ThinkPHP 跨模块调用操作方法(A方法与R方法) 跨模块调用操作方法 前面说了可以使用 $this 来调用当前模块内的方法,但实际情况中还经常会在当前模块调用其他模块的方法.ThinkPHP 内 ...

  9. java判断string数组中是否包含某个元素

  10. C++11时间具体解释

    转载请注明出处:http://blog.csdn.net/luotuo44/article/details/46854229 C++ 11添加了三个与时间相关的类型:时间段.时钟.时间点. 以史为鉴 ...