@c -*-texinfo-*-
@c This is part of the GNU Emacs Lisp Reference Manual.
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
-@c Free Software Foundation, Inc.
+@c Free Software Foundation, Inc.
@c See the file elisp.texi for copying conditions.
@setfilename ../info/objects
@node Lisp Data Types, Numbers, Introduction, Top
@node Floating Point Type
@subsection Floating Point Type
- Emacs supports floating point numbers (though there is a compilation
-option to disable them). The precise range of floating point numbers is
-machine-specific.
+ Floating point numbers are the computer equivalent of scientific
+notation. The precise number of significant figures and the range of
+possible exponents is machine-specific; Emacs always uses the C data
+type @code{double} to store the value.
The printed representation for floating point numbers requires either
a decimal point (with at least one digit following), an exponent, or
The usual read syntax for alphanumeric characters is a question mark
followed by the character; thus, @samp{?A} for the character
@kbd{A}, @samp{?B} for the character @kbd{B}, and @samp{?a} for the
-character @kbd{a}.
+character @kbd{a}.
For example:
@cindex escape
@cindex @samp{\e}
You can express the characters Control-g, backspace, tab, newline,
-vertical tab, formfeed, return, and escape as @samp{?\a}, @samp{?\b},
-@samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f}, @samp{?\r}, @samp{?\e},
-respectively. Thus,
+vertical tab, formfeed, return, del, and escape as @samp{?\a},
+@samp{?\b}, @samp{?\t}, @samp{?\n}, @samp{?\v}, @samp{?\f},
+@samp{?\r}, @samp{?\d}, and @samp{?\e}, respectively. Thus,
@example
?\a @result{} 7 ; @r{@kbd{C-g}}
character. This distinction is possible only when you use X terminals
or other special terminals; ordinary terminals do not report the
distinction to the computer in any way. The Lisp syntax for
-the shift bit is @samp{\S-}; thus, @samp{?\C-\S-o} or @samp{?\C-\S-O}
+the shift bit is @samp{\S-}; thus, @samp{?\C-\S-o} or @samp{?\C-\S-O}
represents the shifted-control-o character.
@cindex hyper characters
and the hexadecimal character code. You can use any number of hex
digits, so you can represent any character code in this way.
Thus, @samp{?\x41} for the character @kbd{A}, @samp{?\x1} for the
-character @kbd{C-a}, and @code{?\x8e0} for the character
+character @kbd{C-a}, and @code{?\x8e0} for the Latin-1 character
@iftex
@samp{@`a}.
@end iftex
@samp{-+=*/}. Such names require no special punctuation; the characters
of the name suffice as long as the name does not look like a number.
(If it does, write a @samp{\} at the beginning of the name to force
-interpretation as a symbol.) The characters @samp{_~!@@$%^&:<>@{@}} are
+interpretation as a symbol.) The characters @samp{_~!@@$%^&:<>@{@}?} are
less often used but also require no special punctuation. Any other
characters may be included in a symbol's name by escaping them with a
backslash. In contrast to its use in strings, however, a backslash in
@end group
@end example
+@ifinfo
+@c This uses ``colon'' instead of a literal `:' because Info cannot
+@c cope with a `:' in a menu
+@cindex @samp{#@var{colon}} read syntax
+@end ifinfo
+@ifnotinfo
@cindex @samp{#:} read syntax
+@end ifnotinfo
Normally the Lisp reader interns all symbols (@pxref{Creating
Symbols}). To prevent interning, you can write @samp{#:} before the
name of the symbol.
Arrays are further subdivided into strings, vectors, char-tables and
bool-vectors. Vectors can hold elements of any type, but string
elements must be characters, and bool-vector elements must be @code{t}
-or @code{nil}. The characters in a string can have text properties like
-characters in a buffer (@pxref{Text Properties}); vectors and
-bool-vectors do not support text properties even when their elements
-happen to be characters. Char-tables are like vectors except that they
-are indexed by any valid character code.
+or @code{nil}. Char-tables are like vectors except that they are
+indexed by any valid character code. The characters in a string can
+have text properties like characters in a buffer (@pxref{Text
+Properties}), but vectors do not support text properties, even when
+their elements happen to be characters.
Lists, strings and the other array types are different, but they have
important similarities. For example, all have a length @var{l}, and all
@code{(@var{a} .@: @var{b})} stands for a cons cell whose @sc{car} is
the object @var{a}, and whose @sc{cdr} is the object @var{b}. Dotted
pair notation is therefore more general than list syntax. In the dotted
-pair notation, the list @samp{(1 2 3)} is written as @samp{(1 . (2 . (3
+pair notation, the list @samp{(1 2 3)} is written as @samp{(1 . (2 . (3
. nil)))}. For @code{nil}-terminated lists, you can use either
notation, but list notation is usually clearer and more convenient.
When printing a list, the dotted pair notation is only used if the
@example
(setq alist-of-colors
- '((rose . red) (lily . white) (buttercup . yellow)))
+ '((rose . red) (lily . white) (buttercup . yellow)))
@end example
@noindent
in documentation strings,
but the newline is \
ignored if escaped."
- @result{} "It is useful to include newlines
-in documentation strings,
+ @result{} "It is useful to include newlines
+in documentation strings,
but the newline is ignored if escaped."
@end example
represent a unibyte non-@sc{ascii} character with its character code,
which must be in the range from 128 (0200 octal) to 255 (0377 octal).
This forces a unibyte string.
-
+
@xref{Text Representations}, for more information about the two
text representations.
Character category tables (@pxref{Categories}).
@item
-Display Tables (@pxref{Display Tables}).
+Display tables (@pxref{Display Tables}).
@item
Syntax tables (@pxref{Syntax Tables}).
constant that follows actually specifies the contents of the bool-vector
as a bitmap---each ``character'' in the string contains 8 bits, which
specify the next 8 elements of the bool-vector (1 stands for @code{t},
-and 0 for @code{nil}). The least significant bits of the character
+and 0 for @code{nil}). The least significant bits of the character
correspond to the lowest indices in the bool-vector. If the length is not a
multiple of 8, the printed representation shows extra elements, but
these extras really make no difference.