(lispref.info)Types of Lisp Object

Next: Numbers Prev: Introduction Up: Top

Lisp Data Types

   A Lisp "object" is a piece of data used and manipulated by Lisp
programs.  For our purposes, a "type" or "data type" is a set of
possible objects.

   Every object belongs to at least one type.  Objects of the same type
have similar structures and may usually be used in the same contexts.
Types can overlap, and objects can belong to two or more types.
Consequently, we can ask whether an object belongs to a particular type,
but not for "the" type of an object.

   A few fundamental object types are built into Emacs.  These, from
which all other types are constructed, are called "primitive types".
Each object belongs to one and only one primitive type.  These types
include "integer", "float", "cons", "symbol", "string", "vector",
"subr", "byte-code function", and several special types, such as
"buffer", that are related to editing.  (Note: Editing Types.)

   Each primitive type has a corresponding Lisp function that checks
whether an object is a member of that type.

   Note that Lisp is unlike many other languages in that Lisp objects
are "self-typing": the primitive type of the object is implicit in the
object itself.  For example, if an object is a vector, it cannot be
treated as a number because Lisp knows it is a vector, not a number.

   In most languages, the programmer must declare the data type of each
variable, and the type is known by the compiler but not represented in
the data.  Such type declarations do not exist in Emacs Lisp.  A Lisp
variable can have any type of value, and remembers the type of any value
you store in it.

   This chapter describes the purpose, printed representation, and read
syntax of each of the standard types in GNU Emacs Lisp.  Details on how
to use these types can be found in later chapters.

* Printed Representation
How Lisp objects are represented as text.
* Comments
Comments and their formatting conventions.
* Programming Types
Types found in all Lisp systems.
* Editing Types
Types specific to Emacs.
* Window-System Types
Types specific to windowing systems.
* Type Predicates
Tests related to types.
* Equality Predicates
Tests of equality between any two objects.

automatically generated by info2www