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. tp5页面跳转,空控制器空方法

    namespace app\index\controller; use think\Controller; class Login extends Controller{ //显示html页面 pub ...

  2. 微信小程序,canvas绘图,样式错乱

    问题1:文字样式错乱 使用以下方式分模块绘制, ctx.save()//...ctx.restore() 绘制完后,定时500毫秒再保存图片 ctx.draw(false, () => { se ...

  3. [C#学习笔记之异步编程模式2]BeginInvoke和EndInvoke方法 (转载)

    为什么要进行异步回调?众所周知,普通方法运行,是单线程的,如果中途有大型操作(如:读取大文件,大批量操作数据库,网络传输等),都会导致方法阻塞,表现在界面上就是,程序卡或者死掉,界面元素不动了,不响应 ...

  4. 操作mysql操作数据库

    操作数据库 查询数据库:show databases: 增加数据库:create database student default character set uft-8:(设置默认字符集) 删除数据 ...

  5. 测试用html

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  6. CentOS7上安装google谷歌浏览器

      1.首先进入根目录,然后进入etc/yum.repos.d目录下,创建google-chrome.repo文件 cd / cd etc/yum.repos.d vim google-chrome. ...

  7. Layui表格编辑【不依赖Layui的动态table加载】

    依赖jquer,layui/css <td class="My_edit"></td> Jquery代码 //-----[Layui表格编辑(<td ...

  8. 什么是PL/SQL,有什么用

    1.什么是PL/SQL,有什么用  Procedure Language+SQL  PL/SQL是Oracle数据库特有的编程语言.  PL/SQL程序是以SQL为基础,引入了  编程语言特点,例如变 ...

  9. COJS 1752. [BOI2007]摩基亚Mokia

    1752. [BOI2007]摩基亚Mokia ★★★   输入文件:mokia.in   输出文件:mokia.out   简单对比时间限制:5 s   内存限制:128 MB [题目描述] 摩尔瓦 ...

  10. LeetCode104_MaximumDepthofBinaryTree Java题解

    题目: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the ...