| • Science | • People | • Locations | • Timeline |
Common Lisp is a general-purpose programming language, in contrast to Lisp variants such as Emacs Lisp and AutoLISP which are embedded extension languages in particular products. Unlike many earlier Lisps, but like Scheme, Common Lisp uses lexical scoping for variables.
Common Lisp is a multi-paradigm programming language that:
Common Lisp is a Lisp; it uses S-expressions to denote both code and data structure. Function and macro calls are written as lists, with the name of the function first, as in these examples:
(+ 2 2) ; adds 2 and 2, yielding 4 ( setq p 3.1415) ; sets the variable "p" equal to 3.1415
Common Lisp has a plethora of data types, more than many languages.
Number types include integers, ratios, floating-point numbers, and complex numbers. Common Lisp uses bignumA bignum package in a computer or program allows internal representation of arbitrarily large integers, rational numbers, decimal numbers, or floating-point numbers, and provides a set of arithmetic operations on such numbers. Numbers are typically storeds to represent numerical values of arbitrary size and precision. The ratio type represents fractions exactly, a facility not available in many languages. Common Lisp automatically coerces numeric values among these types as appropriate.
The Common Lisp characterFor alternate meanings, see character. In computer terminology, a character is a unit of information that roughly corresponds to a grapheme, or written symbol, of a natural language, such as a letter, numeral, or punctuation mark. The concept also include type is not limited to ASCIIASCII A merican S tandard C ode for I nformation I nterchange , generally pronounced 'aski', is a character set and a character encoding based on the Roman alphabet as used in modern English and other Western European languages. It is most commonly used b characters -- unsurprising, as Lisp predates ASCII. Some modern implementations allow UnicodeIn computing, Unicode is the international standard whose goal is to provide the means to encode the text of every document people want to store in computers. This includes all scripts still in active use today, many scripts known only by scholars, and sy characters. [1]
The symbolA symbol or (in many senses) token is a representation of something — an idea, object, concept, quality, etc. Nature of symbols A symbol can be a material object whose shape or origin is related, by nature or convention, to the thing it represents: for in type is common to Lisp languages, but largely unknown outside them. A symbol is a unique, named data object. Symbols in Lisp are similar to identifiers in other languages, in that they are used as variables to hold values; however, they are more general and can be used for themselves as well. Normally, when a symbol is evaluated, its value as a variable is returned. Exceptions exist: keyword symbols such as :foo evaluate to themselves, and Boolean values in Common Lisp are represented by the reserved symbols T and NIL.