Boolean Data Type - Lisp and Scheme

Lisp and Scheme

The Lisp language (1958) never had a built-in Boolean data type. Instead, conditional constructs like cond assume that the logical value "false" is represented by the empty list , which is defined to be the same as the special atom nil or NIL; whereas any other s-expression is interpreted as "true". For convenience, most modern dialects of Lisp predefine the atom t to have value t, so that one can use t as a mnemonic notation for "true".

This approach ("any value can be used as a Boolean value") was retained in most Lisp dialects (Common Lisp, Scheme, Emacs Lisp), and similar models were adopted by many scripting languages, even ones that do have a distinct Boolean type or Boolean values; although which values are interpreted as "false" and which are "true" vary from language to language. In Scheme, for example, the "false" value is an atom distinct from the empty list, so the latter is interpreted as "true".

Read more about this topic:  Boolean Data Type

Famous quotes containing the words lisp and/or scheme:

    Taught me my alphabet to say,
    To lisp my very earliest word,
    Edgar Allan Poe (1809–1849)

    Television programming for children need not be saccharine or insipid in order to give to violence its proper balance in the scheme of things.... But as an endless diet for the sake of excitement and sensation in stories whose plots are vehicles for killing and torture and little more, it is not healthy for young children. Unfamiliar as yet with the full story of human response, they are being misled when they are offered perversion before they have fully learned what is sound.
    Dorothy H. Cohen (20th century)