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. html5 好用功能总结

    1.表格元素 a.<caption>设置表格标题 b.<colgroup> . <col> 设置列 //style span 2.分组元素 a.<blockq ...

  2. 动态库连接器–动态库链接信息(Mach-O文件格式和程序从加载到执行过程)

    section cmd 说明 举例 __text 主程序代码   __stubs 用于动态库链接的桩   __stub_helper 用于动态库链接的桩   __cstring 常亮字符串符号表描述信 ...

  3. CorelDRAW教程:怎样绘制制作箭头流程图?

    箭头流程图主要由矢量图和连接符组成,通过图形之间的顺序阐述的一个过程,应用也是非常广泛,有些软件中会自带流程图,对于CDR这款矢量绘图软件来说,手动制作流程图是简单且高效的.首先CorelDRAW中就 ...

  4. spring-session与redis实现session共享

    一.准备 两个不同端口号的输出request.getLocalPort() + " ---> " + request.getSession(true).getId()的简单S ...

  5. jq——css类

    1  addClass(classname) 添加类 <script type="text/javascript"> $("input").clic ...

  6. Git diff 代码比较的高级技巧

    Git diff 代码比较的高级技巧 作者:offbye 出处:http://blog.csdn.net/offbye/article/details/6592563 Git是使用branch来管理不 ...

  7. IOS - PDF合并

    #pragma mark - Merge PDF - (void)mergePDF { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSD ...

  8. BZOJ 3203 [SDOI2013]保护出题人 (凸包+三分)

    洛谷传送门 题目大意:太长略 每新加入一个僵尸,容易得到方程$ans[i]=max{\frac{sum_{i}-sum_{j-1}}{s_{i}+d(i-j)}}$ 即从头开始每一段僵尸都需要在规定距 ...

  9. 2.安装Cython

    许多科学的Python发行版,例如Anaconda,Enthought Canopy和Sage,捆绑Cython并且不需要设置. 与大多数Python软件不同,Cython需要在系统上存在C编译器.获 ...

  10. linux上重启jboss服务器

    ps -ef|grep jboss  :查看当前jboss进程 kill -9 进程id         :杀掉进程,kill -9发送的信号是SIGKILL,即exit.exit信号不会被系统阻塞 ...