In a given programming language design, a first-class citizen 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.
The concept of first- and second-class objects was introduced by Christopher Strachey in the 1960s. He did not actually define the term strictly, but contrasted real numbers and procedures in ALGOL:
First and second class objects. In ALGOL, a real number may appear in an expression or be assigned to a variable, and either of them 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)...
Robin Popplestone gave the following definition:
All items have certain fundamental rights.
All items can be the actual parameters of functions
All items can be returned as results of functions
All items can be the subject of assignment statements
All items can be tested for equality.
During the 1990s, Raphael Finkel proposed definitions of second and third class values, but these definitions have not been widely adopted.
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.
Cette page est générée automatiquement et peut contenir des informations qui ne sont pas correctes, complètes, à jour ou pertinentes par rapport à votre recherche. Il en va de même pour toutes les autres pages de ce site. Veillez à vérifier les informations auprès des sources officielles de l'EPFL.
Le cours propose d'expérimenter les spécificités du design industriel en confrontant les étudiant.e.s à la création d'un objet. Il s'agit d'un enseignement pratique dont le résultat est un objet fonct
Le cours propose d'expérimenter les spécificités du design industriel en confrontant les étudiant.e.s à la création d'un objet. Il s'agit d'un enseignement pratique dont le résultat est un objet fonct
In computer science, a programming language is said to have first-class functions if it treats functions as first-class citizens. This means the language supports passing functions as arguments to other functions, returning them as the values from other functions, and assigning them to variables or storing them in data structures. Some programming language theorists require support for anonymous functions (function literals) as well.
En programmation, une métaclasse est une classe dont les instances sont des classes. Autrement dit, une métaclasse est la classe d'une classe. En programmation orientée objet, une classe est une sorte de module qui permet de créer un sous-ensemble d'objets. La classe décrit comment se comportent ses objets, fournit leur interface et compose la structure de leur état. La classe permet de créer de nouveaux objets au moyen d'un mécanisme appelé instanciation.
Eval est une fonction utilisée en programmation. Elle est présente dans de nombreux langages interprétés et permet d'exécuter une commande à partir d'une chaîne de caractères (ou String) générée par le programme lui-même en cours d'exécution.
Démontre une approche métacirculaire pour interpréter efficacement les fonctions d'ordre supérieur en utilisant des environnements et des fonctions de première classe.
In High-Level Synthesis (HLS), we consider abstractions that span from software to hardware and target heterogeneous architectures. Therefore, managing the complexity introduced by this is key to implementing good, maintainable, and extendible HLS compiler ...
2022
,
Type inference in the presence of first-class or "impredicative" second-order polymorphism a la System F has been an active research area for several decades, with original works dating back to the end of the 80s. Yet, until now many basic problems remain ...
The pursuit of software security and reliability hinges on the identification and elimination of software vulnerabilities, a challenge compounded by the vast and evolving complexity of modern systems. Fuzzing has emerged as an indispensable technique for b ...