Cons

(Lisp Programming Language)

Tech

skills
Lisp Programming Language
Link to Dbpedia

What is Cons?

In computer programming, <span class="nb">cons</span> is a fundamental function in most dialects of the Lisp programming language. <span class="nb">cons</span> constructs memory objects which hold two values or pointers to values. These objects are referred to as (cons) cells, conses, non-atomic s-expressions ("NATSes"), or (cons) pairs. In Lisp jargon, the expression "to cons x onto y" means to construct a new object with (cons <i>x</i> <i>y</i>). The resulting pair has a left half, referred to as the <span class="nb">car</span> (the first element, or content of address register), and a right half (the second element, or content of decrement register), referred to as the <span class="nb">cdr</span>. It is loosely related to the object-oriented notion of a constructor, which creates a new object given arguments, and more closely related to the constructor function of an algebraic data type system. The word "cons" and expressions like "to cons onto" are also part of a more general functional programming jargon. Sometimes operators that have a similar purpose, especially in the context of list processing, are pronounced "cons". (A good example is the :: operator in ML, Scala, F# and Elm or the : operator in Haskell, which adds an element to the beginning of a list.)

Technology Types

composite data typedata typefunctional programminglisp programming language

Translations

تابع cons列表構造函數

Synonyms

conscons (funzione)cons cellcons cellcons pairsnoc

RelatedTo

appendarraysccdrclojurecommon-lispconsdata-structuresf#functional-programminghaskelljavalinked-listlisplistocamlpattern-matchingpythonracketrecursionrustscalaschemesequencesicptuples

Co-Occuring

algebraic-data-typescarcdrcollectioncomputer-scienceconsfpfunctionalimmutablejavalisplisp-likelistnullpairspythonqueueracketscheme-likesicpstack

Tech Info

Important Persons & Organizations


    Sources: DBpedia, Github, Stackoverflow, Wikidata
     — Date merged: 04.02.2022, 17:50
     — Date scraped: 20.05.2021, 17:38