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 (18091849)
“We doubt not the destiny of our countrythat she is to accomplish great things for human nature, and be the mother of a nobler race than the world has yet known. But she has been so false to the scheme made out at her nativity, that it is now hard to say which way that destiny points.”
—Margaret Fuller (18101850)