Cons
Function and primitive data structure in Lisp and other functional programming languages
In computer programming, cons ( or ) is a fundamental function in most dialects of the Lisp programming language. cons constructs memory objects which hold two values or pointers to two values. These objects are referred to as (cons) cells, conses, non-atomic s-expressions ("NATSes"), or (cons) pairs.
Nº Q3687178 ★
Common · Knowledge
Cons
Function and primitive data structure in Lisp and other functional programming languages
In computer programming, cons ( or ) is a fundamental function in most dialects of the Lisp programming language. cons constructs memory objects which hold two values or pointers to two values. These objects are referred to as (cons) cells, conses, non-atomic s-expressions ("NATSes"), or (cons) pairs.
From Wikipedia
In computer programming, cons ( or ) is a fundamental function in most dialects of the Lisp programming language. cons constructs memory objects which hold two values or pointers to two 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 x y). The resulting pair has a left half, referred to as the car (the first element, or contents of the address part of register), and a right half, referred to as the cdr (the second element, or contents of the decrement part of register). 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#, Lean, Rocq, and Elm or the : operator in Haskell, which adds an element to the beginning of a list.)
Text: Wikipédia, CC BY-SA 4.0. ·
Related cards
-
F
Function object
Programming construct allowing an object to be invoked or called as if it were an ordinary function, usually with the same syntax
Nº Q2072111 ★
Not listed
-
C
Cis (mathematics)
Mathematical notation for cos(x) + i sin(x)
Nº Q22093344 ★
Not listed
-
Convex function
Real function with secant line between points above the graph itself
Nº Q319913 ★★
Not listed
-
X
X86 calling conventions
Calling conventions used in x86 architecture programming
Nº Q4405409 ★★
Not listed
-
Cgroups
Resource limit method in Linux
Nº Q307299 ★★
Not listed
-
D
Data segment
Storage segment
Nº Q491179 ★
Not listed