Author: cpage
Date: Sat Dec 10 09:36:29 2005
New Revision: 10401
Modified:
trunk/www/books/drm/drm.css
trunk/www/books/drm/drm_1.html
trunk/www/books/drm/drm_12.html
trunk/www/books/drm/drm_13.html
trunk/www/books/drm/drm_14.html
trunk/www/books/drm/drm_15.html
trunk/www/books/drm/drm_16.html
trunk/www/books/drm/drm_17.html
trunk/www/books/drm/drm_18.html
trunk/www/books/drm/drm_19.html
trunk/www/books/drm/drm_20.html
trunk/www/books/drm/drm_22.html
trunk/www/books/drm/drm_23.html
trunk/www/books/drm/drm_24.html
trunk/www/books/drm/drm_26.html
trunk/www/books/drm/drm_36.html
trunk/www/books/drm/drm_40.html
trunk/www/books/drm/drm_41.html
trunk/www/books/drm/drm_42.html
trunk/www/books/drm/drm_43.html
trunk/www/books/drm/drm_48.html
trunk/www/books/drm/drm_49.html
trunk/www/books/drm/drm_50.html
trunk/www/books/drm/drm_54.html
trunk/www/books/drm/drm_56.html
trunk/www/books/drm/drm_57.html
trunk/www/books/drm/drm_60.html
trunk/www/books/drm/drm_61.html
trunk/www/books/drm/drm_62.html
trunk/www/books/drm/drm_64.html
trunk/www/books/drm/drm_65.html
trunk/www/books/drm/drm_67.html
trunk/www/books/drm/drm_68.html
trunk/www/books/drm/drm_71.html
trunk/www/books/drm/drm_72.html
trunk/www/books/drm/drm_8.html
trunk/www/books/drm/drm_93.html
trunk/www/books/drm/drm_98.html
Log:
Job: website
Fixed all the cases where STRONG was used instead of or in addition to
DFN. Now, defining terms are all tagged appropriately with DFN.
Modified: trunk/www/books/drm/drm.css
==============================================================================
--- trunk/www/books/drm/drm.css (original)
+++ trunk/www/books/drm/drm.css Sat Dec 10 09:36:29 2005
@@ -291,14 +291,8 @@
/*
Always use bold for defining instance text (DFN tags), to match the
- printed DRM, since it specifically says they are set in bold. Two notes:
-
- 1. As it happens, the HTML was originally generated with STRONG tags (and
- no DFNs), so it usually renders in bold, but now that we have a
- style sheet, use it to ensure the formatting is as desired.
-
- 2. Some browsers apply italics to DFN (in addition to bold), so be sure
- to suppress that.
+ printed DRM, since it specifically says they are set in bold. Some
+ browsers render DFN in italics, so be sure to suppress that.
*/
dfn { font-weight: bold; font-style: normal }
Modified: trunk/www/books/drm/drm_1.html
==============================================================================
--- trunk/www/books/drm/drm_1.html (original)
+++ trunk/www/books/drm/drm_1.html Sat Dec 10 09:36:29 2005
@@ -117,7 +117,7 @@
<h1 class="book-title">The Dylan Reference Manual</h1>
<p class="subtitle">The Definitive Guide to the New<br />
Object-Oriented Dynamic Language</p>
- <p class="author"><strong class="bold author">Andrew Shalit</strong></p>
+ <p class="author"><strong>Andrew Shalit</strong></p>
<p class="contributor">With contributions by David Moon and Orca
Starbuck</p>
<p class="Modelsw/Sub">[This HTML version corresponds to the book
published by Addison-Wesley in 1996.]</p>
Modified: trunk/www/books/drm/drm_12.html
==============================================================================
--- trunk/www/books/drm/drm_12.html (original)
+++ trunk/www/books/drm/drm_12.html Sat Dec 10 09:36:29 2005
@@ -124,20 +124,18 @@
<a name="HEADING12-0"></a>
<a name="UID-Syntax-1434"></a>
<h1 class="section-title">Bindings</h1>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-225"></a><dfn>binding</dfn></strong>
- is an association of a name with a value. The bindings in a module
persist for the life of the
- program execution. The scope of such a binding is its module. That is,
the binding is visible
- to all source-records in the module. A module can export bindings and
can import bindings from
- other modules. Only an exported binding can be imported. A binding is
visible to all
- source-records in a module that imports it.</p>
- <p class="T1.Text1">A binding may
- be <strong class="bold"><a
name="MARKER-2-226"></a><dfn>specialized</dfn></strong>. This
+ <p class="T1.Text1">A <a name="MARKER-2-225"></a><dfn>binding</dfn> is
an association of a
+ name with a value. The bindings in a module persist for the life of the
program execution. The
+ scope of such a binding is its module. That is, the binding is visible
to all source-records
+ in the module. A module can export bindings and can import bindings from
other modules. Only
+ an exported binding can be imported. A binding is visible to all
source-records in a module
+ that imports it.</p>
+ <p class="T1.Text1">A binding may be <a
name="MARKER-2-226"></a><dfn>specialized</dfn>. This
restricts the types of values that may be held in the binding. An error
will be signaled on
any attempt to initialize or assign the binding to a value that is not
of the correct
type.</p>
- <p class="T1.Text1">A binding is
- either <strong class="Bold"><a
name="MARKER-2-227"></a><dfn>constant</dfn></strong>
- or <strong class="Bold"><a
name="MARKER-2-228"></a><dfn>variable</dfn></strong>. A constant
+ <p class="T1.Text1">A binding is either <a
name="MARKER-2-227"></a><dfn>constant</dfn>
+ or <a name="MARKER-2-228"></a><dfn>variable</dfn>. A constant
(or <a name="MARKER-2-229"></a>read-only) binding always has the same
value. In contrast, a
variable (or writable) binding can have its value changed, using the
assignment
operator <code>:=</code>. Most bindings in a typical Dylan module are
constant.</p>
Modified: trunk/www/books/drm/drm_13.html
==============================================================================
--- trunk/www/books/drm/drm_13.html (original)
+++ trunk/www/books/drm/drm_13.html Sat Dec 10 09:36:29 2005
@@ -124,13 +124,13 @@
<a name="HEADING13-0"></a>
<a name="UID-Syntax-1437"></a>
<h1 class="section-title">Macros</h1>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-230"></a><dfn>macro</dfn></strong>
- is an extension to the core language that can be defined by the
programmer, by the
- implementation, or as part of the Dylan language specification. Much of
the grammatical
- structure of Dylan is built with macros. A macro defines the meaning of
one construct in terms
- of another construct. The original construct is the call to the macro.
The replacement
- construct is the <a name="MARKER-2-231"></a>expansion of the macro. The
compiler processes the
- expansion in place of the call.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-230"></a><dfn>macro</dfn> is an
extension to the core
+ language that can be defined by the programmer, by the implementation,
or as part of the Dylan
+ language specification. Much of the grammatical structure of Dylan is
built with macros. A
+ macro defines the meaning of one construct in terms of another
construct. The original
+ construct is the call to the macro. The replacement construct is
+ the <a name="MARKER-2-231"></a>expansion of the macro. The compiler
processes the expansion in
+ place of the call.</p>
<p class="T1.Text1">Portions of the call to a macro are substituted into
part of the macro
definition to create the expansion. This substitution preserves the
meanings of names. In
other words, each name inserted into the expansion from the macro call
refers to the same
Modified: trunk/www/books/drm/drm_14.html
==============================================================================
--- trunk/www/books/drm/drm_14.html (original)
+++ trunk/www/books/drm/drm_14.html Sat Dec 10 09:36:29 2005
@@ -124,14 +124,12 @@
<a name="HEADING14-0"></a>
<a name="UID-Syntax-1441"></a>
<h1 class="section-title">Bodies</h1>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-232"></a><dfn>body</dfn></strong>
- is a sequence of zero or more constituents. When multiple constituents
are present, they are
- separated by semicolons. When at least one constituent is present, the
last constituent can
- optionally be followed by a semicolon; this allows programmers to regard
the semicolon as
- either a terminator or a separator, according to their preferred
programming style.</p>
- <p
- class="T1.Text1">A <strong
- class="Bold"><a name="MARKER-2-233"></a><dfn>constituent</dfn></strong>
is either a
+ <p class="T1.Text1">A <a name="MARKER-2-232"></a><dfn>body</dfn> is a
sequence of zero or more
+ constituents. When multiple constituents are present, they are separated
by semicolons. When
+ at least one constituent is present, the last constituent can optionally
be followed by a
+ semicolon; this allows programmers to regard the semicolon as either a
terminator or a
+ separator, according to their preferred programming style.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-233"></a><dfn>constituent</dfn>
is either a
definition, a local declaration, or an expression. Definitions and local
declarations form the
structure of a program and do not return values. In contrast,
expressions are executed for the
values they return and/or the side-effects that they perform.</p>
Modified: trunk/www/books/drm/drm_15.html
==============================================================================
--- trunk/www/books/drm/drm_15.html (original)
+++ trunk/www/books/drm/drm_15.html Sat Dec 10 09:36:29 2005
@@ -124,26 +124,28 @@
<a name="HEADING15-0"></a>
<a name="UID-Syntax-1444"></a>
<h1 class="section-title">Definitions</h1>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-234"></a><dfn>definition</dfn></strong> is
- either a call to a user-defined defining macro, a call to a built-in
defining macro, or a special
- definition. Typically, a definition defines a binding in the module
containing the definition. Some
- definitions define more than one binding, and some do not define any
bindings.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-235"></a><dfn>user-defined defining
- macro</dfn></strong> is a macro that defines a definition in terms of
other constructs. A call to a
- user-defined defining macro always begins with the word
<code>define</code> and includes the name of the
- defining macro. This name when suffixed by "<code>-definer</code>" is
the name of a visible binding
- whose value is the defining macro. The rest of the syntax of a call to a
user-defined defining macro is
- determined by the particular macro. Some definitions include a body.
Advanced programmers often define
- new defining macros as part of structuring a program in a readable and
modular way.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-236"></a><dfn>built-in defining
- macro</dfn></strong> is like a user-defined defining macro but is
specified as part of the Dylan
- language. There are eight built-in defining macros: <code>define
class</code>, <code>define
+ <p class="T1.Text1">A <a name="MARKER-2-234"></a><dfn>definition</dfn>
is either a call to a
+ user-defined defining macro, a call to a built-in defining macro, or a
special
+ definition. Typically, a definition defines a binding in the module
containing the
+ definition. Some definitions define more than one binding, and some do
not define any
+ bindings.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-235"></a><dfn>user-defined
defining macro</dfn> is a
+ macro that defines a definition in terms of other constructs. A call to
a user-defined
+ defining macro always begins with the word <code>define</code> and
includes the name of the
+ defining macro. This name when suffixed by "<code>-definer</code>" is
the name of a visible
+ binding whose value is the defining macro. The rest of the syntax of a
call to a user-defined
+ defining macro is determined by the particular macro. Some definitions
include a
+ body. Advanced programmers often define new defining macros as part of
structuring a program
+ in a readable and modular way.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-236"></a><dfn>built-in defining
macro</dfn> is like a
+ user-defined defining macro but is specified as part of the Dylan
language. There are eight
+ built-in defining macros: <code>define class</code>, <code>define
constant</code>, <code>define generic</code>, <code>define
domain</code>, <code>define
library</code>, <code>define method</code>, <code>define module</code>,
and <code>define
variable</code>.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-237"></a><dfn>special
- definition</dfn></strong> is a definition construct that is built into
the grammar of Dylan. There is
- only one special definition: <code>define macro</code>.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-237"></a><dfn>special
definition</dfn> is a definition
+ construct that is built into the grammar of Dylan. There is only one
special
+ definition: <code>define macro</code>.</p>
<p class="T1.Text1">An implementation can add new kinds of definitions
as language extensions. Such
definitions may be implemented as special definitions. However, they
will more commonly take the form of
user-defined definition macros that are the values of bindings exported
by implementation-defined
Modified: trunk/www/books/drm/drm_16.html
==============================================================================
--- trunk/www/books/drm/drm_16.html (original)
+++ trunk/www/books/drm/drm_16.html Sat Dec 10 09:36:29 2005
@@ -124,10 +124,10 @@
<a name="HEADING16-0"></a>
<a name="UID-Syntax-1450"></a>
<h1 class="section-title">Local Declarations</h1>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-238"></a><dfn>local
- declaration</dfn></strong> is a construct that establishes <a
name="MARKER-2-239"></a>local
- bindings or <a name="MARKER-2-240"></a>condition handlers whose scope is
the remainder of the
- body following the local declaration.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-238"></a><dfn>local
declaration</dfn> is a construct
+ that establishes <a name="MARKER-2-239"></a>local bindings
+ or <a name="MARKER-2-240"></a>condition handlers whose scope is the
remainder of the body
+ following the local declaration.</p>
<p class="T1.Text1">Unlike module bindings, local bindings are
established during program
execution, each time the local declaration is executed. They persist for
as long as code in
their scope is active. Local bindings persist after the body containing
them returns if they
@@ -142,19 +142,17 @@
<p class="T1.Text1">There are three kinds of local declaration: local
value bindings
(<code>let</code>), local method bindings (<code>local</code>), and
condition handler
establishment (<code>let handler</code>).</p>
- <p class="T1.Text1">The <strong class="Bold"><a
name="MARKER-2-242"></a><dfn>local value
- bindings</dfn></strong> construct, <code>let</code>, executes an
expression and locally binds
- names to the values returned by that expression.</p>
- <p class="T1.Text1">The <strong class="Bold"><a
name="MARKER-2-243"></a><dfn>local method
- bindings</dfn></strong> construct, <code>local</code>, locally binds
names to bare
- methods. These bindings are visible in the remainder of the body and
also inside the methods,
- permitting recursion.</p>
- <p class="T1.Text1">The <strong class="Bold"><a
name="MARKER-2-244"></a><dfn>condition handler
- establishing</dfn></strong> construct, <code>let handler</code>,
establishes a function to be
- called if a condition of a given type is signaled during the execution
of the remainder of the
- body or anything the body calls. The handler is disestablished as soon
as the body
- returns. Unlike the other two kinds of local declaration, <code>let
handler</code> does not
- establish any bindings.</p>
+ <p class="T1.Text1">The <a name="MARKER-2-242"></a><dfn>local value
bindings</dfn>
+ construct, <code>let</code>, executes an expression and locally binds
names to the values
+ returned by that expression.</p>
+ <p class="T1.Text1">The <a name="MARKER-2-243"></a><dfn>local method
bindings</dfn>
+ construct, <code>local</code>, locally binds names to bare methods.
These bindings are visible
+ in the remainder of the body and also inside the methods, permitting
recursion.</p>
+ <p class="T1.Text1">The <a name="MARKER-2-244"></a><dfn>condition
handler establishing</dfn>
+ construct, <code>let handler</code>, establishes a function to be called
if a condition of a
+ given type is signaled during the execution of the remainder of the body
or anything the body
+ calls. The handler is disestablished as soon as the body returns. Unlike
the other two kinds
+ of local declaration, <code>let handler</code> does not establish any
bindings.</p>
</div>
Modified: trunk/www/books/drm/drm_17.html
==============================================================================
--- trunk/www/books/drm/drm_17.html (original)
+++ trunk/www/books/drm/drm_17.html Sat Dec 10 09:36:29 2005
@@ -124,18 +124,19 @@
<a name="HEADING17-0"></a>
<a name="UID-Syntax-1456"></a>
<h1 class="section-title">Expressions</h1>
- <p class="T1.Text1">An <strong class="Bold"><a
name="MARKER-2-245"></a><dfn>expression</dfn></strong> is
- a construct that is executed for the values it returns and/or the
side-effects that it performs. The
- "active" portions of a Dylan program are expressions. An expression is
either a literal constant, a
- named value reference, a function call, a unary operator call, a binary
operator call, an element
- reference, a slot reference, a parenthesized expression, or a
statement.</p>
- <p class="T1.Text1">An <strong class="Bold"><a
name="MARKER-2-246"></a><dfn>operand</dfn></strong> is a
- restricted expression: it cannot be a unary or binary operator call nor
a symbol literal. The other
- seven forms of expression are allowed. Operands appear in situations in
the grammar where an expression
- is desirable but the full generality of expressions would make the
grammar ambiguous.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-247"></a><dfn>literal
- constant</dfn></strong> directly represents an object. Literal constants
are available for numbers,
- characters, strings, symbols, boolean values, pairs, lists, and vectors.
For example:</p>
+ <p class="T1.Text1">An <a name="MARKER-2-245"></a><dfn>expression</dfn>
is a construct that is
+ executed for the values it returns and/or the side-effects that it
performs. The "active"
+ portions of a Dylan program are expressions. An expression is either a
literal constant, a
+ named value reference, a function call, a unary operator call, a binary
operator call, an
+ element reference, a slot reference, a parenthesized expression, or a
statement.</p>
+ <p class="T1.Text1">An <a name="MARKER-2-246"></a><dfn>operand</dfn> is
a restricted
+ expression: it cannot be a unary or binary operator call nor a symbol
literal. The other seven
+ forms of expression are allowed. Operands appear in situations in the
grammar where an
+ expression is desirable but the full generality of expressions would
make the grammar
+ ambiguous.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-247"></a><dfn>literal
constant</dfn> directly
+ represents an object. Literal constants are available for numbers,
characters, strings,
+ symbols, boolean values, pairs, lists, and vectors. For example:</p>
<table>
<tr>
<td class="primary"><p class="TbT.TblText"> <a
name="MARKER-2-207"></a>number</p></td>
@@ -173,14 +174,14 @@
<p class="T1.Text1">A string literal can be broken across lines by
writing two string literals in a row,
separated only by whitespace; they are automatically concatenated
(without a newline
character).<a name="MARKER-2-251"></a></p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-252"></a><dfn>named value
- reference</dfn></strong> returns the value of a visible binding given
its name; for
- example, <code>foo</code>. The referenced binding can be a module
binding (either constant or variable)
- or a local binding established by a local declaration or by a parameter
list. The value of the binding
- must not be a macro.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-253"></a><dfn>reserved word</dfn></strong>
- is a syntactic token that has the form of a name but is reserved by the
Dylan language and so cannot
- be given a binding and cannot be used as a named value reference. There
are seven reserved words in
+ <p class="T1.Text1">A <a name="MARKER-2-252"></a><dfn>named value
reference</dfn> returns the
+ value of a visible binding given its name; for example,
<code>foo</code>. The referenced
+ binding can be a module binding (either constant or variable) or a local
binding established
+ by a local declaration or by a parameter list. The value of the binding
must not be a
+ macro.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-253"></a><dfn>reserved
word</dfn> is a syntactic token
+ that has the form of a name but is reserved by the Dylan language and
so cannot be given a
+ binding and cannot be used as a named value reference. There are seven
reserved words in
Dylan:
<code><a name="MARKER-2-254"></a>define</code>,
<code><a name="MARKER-2-255"></a>end</code>,
@@ -189,42 +190,43 @@
<code><a name="MARKER-2-258"></a>local</code>,
<code><a name="MARKER-2-259"></a>macro</code>,
and <code><a name="MARKER-2-260"></a>otherwise</code>.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-261"></a><dfn>function call</dfn></strong>
- applies a function to arguments, and returns whatever values the
function returns. The function is
- indicated by an operand and can be a generic function, a method, or a
function macro. The arguments are
- separated by commas and enclosed in parentheses. For example, <code>f(x,
y)</code>. For readability, the
- comma can be omitted between the two arguments in a keyword/value pair,
for example <code>element(c, k,
- default: d)</code> is a function call with four arguments.</p>
- <p class="T1.Text1"><a name="MARKER-2-262"></a>A <strong class="Bold"><a
name="MARKER-2-263"></a><dfn>unary
- operator call</dfn></strong> consists of an operand preceded by one of
the two unary
+ <p class="T1.Text1">A <a name="MARKER-2-261"></a><dfn>function
call</dfn> applies a function
+ to arguments, and returns whatever values the function returns. The
function is indicated by
+ an operand and can be a generic function, a method, or a function macro.
The arguments are
+ separated by commas and enclosed in parentheses. For example, <code>f(x,
y)</code>. For
+ readability, the comma can be omitted between the two arguments in a
keyword/value pair, for
+ example <code>element(c, k, default: d)</code> is a function call with
four arguments.</p>
+ <p class="T1.Text1"><a name="MARKER-2-262"></a>A <a
name="MARKER-2-263"></a><dfn>unary
+ operator call</dfn> consists of an operand preceded by one of the two
unary
operators: <code>-</code> (arithmetic negation) or <code>~</code>
(logical negation); for
- example, <code>- x</code>. A unary operator call is actually an
abbreviated notation for a function
- call.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-264"></a><dfn>binary operator
- call</dfn></strong> consists of two expressions separated by one of the
binary operators: <code>+</code>
+ example, <code>- x</code>. A unary operator call is actually an
abbreviated notation for a
+ function call.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-264"></a><dfn>binary operator
call</dfn> consists of
+ two expressions separated by one of the binary operators: <code>+</code>
(addition), <code>-</code> (subtraction), <code>*</code>
(multiplication), <code>/</code>
(division), <code>^</code> (exponentiation), <code>=</code> (equality),
<code>==</code>
- (identity), <code><</code> (less than), <code>></code> (greater
than), <code><=</code> (less
- than or equal), <code>>=</code> (greater than or equal),
<code>~=</code> (not
- equal), <code>~==</code> (not identical), <code>&</code> (logical
and), <code>|</code> (logical or),
- or <code>:=</code> (assignment). When binary operator calls are chained
together, they are grouped by
- rules of precedence and associativity and by parentheses — for
example, <code>(a - b) * x + c * x
- ^ 2</code>. A binary operator call is actually an abbreviated notation
for a function call or
- function-macro call. The rules of precedence are given in <a
href="drm_31.html#MARKER-9-427"
+ (identity), <code><</code> (less than), <code>></code> (greater
+ than), <code><=</code> (less than or equal), <code>>=</code>
(greater than or
+ equal), <code>~=</code> (not equal), <code>~==</code> (not identical),
<code>&</code>
+ (logical and), <code>|</code> (logical or), or <code>:=</code>
(assignment). When binary
+ operator calls are chained together, they are grouped by rules of
precedence and associativity
+ and by parentheses — for example, <code>(a - b) * x + c * x ^
2</code>. A binary
+ operator call is actually an abbreviated notation for a function call or
function-macro
+ call. The rules of precedence are given in <a
href="drm_31.html#MARKER-9-427"
class="T1.Text1">Table 4-1, "Operators," on page 37</a>.<a
name="MARKER-2-265"></a></p>
- <p class="T1.Text1">An <strong class="Bold"><a
name="MARKER-2-266"></a><dfn>element
- reference</dfn></strong> consists of an operand that indicates a
collection and an expression in square
- brackets that indicates a key. Instead of a key, there can be multiple
expressions separated by commas
- that indicate array indices; for example, <code>c[k]</code> or
<code>a[i, j]</code>. This is actually an
+ <p class="T1.Text1">An <a name="MARKER-2-266"></a><dfn>element
reference</dfn> consists of an
+ operand that indicates a collection and an expression in square brackets
that indicates a
+ key. Instead of a key, there can be multiple expressions separated by
commas that indicate
+ array indices; for example, <code>c[k]</code> or <code>a[i, j]</code>.
This is actually an
abbreviated notation for a function call.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-267"></a><dfn>slot reference</dfn></strong>
- is another abbreviated notation for a function call. It consists of an
operand that indicates an object,
+ <p class="T1.Text1">A <a name="MARKER-2-267"></a><dfn>slot
reference</dfn> is another
+ abbreviated notation for a function call. It consists of an operand that
indicates an object,
a period, and a named value reference that indicates a one-argument
function to apply to the
object. Typically the function is a slot getter but this is not
required, as
in <code>airplane.wingspan</code>.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-268"></a><dfn>parenthesized
- expression</dfn></strong> is any expression inside parentheses. The
parentheses have no significance
- except to group the arguments of an operator or to turn a general
expression into an operand; for
+ <p class="T1.Text1">A <a name="MARKER-2-268"></a><dfn>parenthesized
expression</dfn> is any
+ expression inside parentheses. The parentheses have no significance
except to group the
+ arguments of an operator or to turn a general expression into an
operand; for
example, <code>(a + b) * c</code>.</p>
</div>
Modified: trunk/www/books/drm/drm_18.html
==============================================================================
--- trunk/www/books/drm/drm_18.html (original)
+++ trunk/www/books/drm/drm_18.html Sat Dec 10 09:36:29 2005
@@ -125,21 +125,21 @@
<a name="UID-Syntax-1509"></a>
<h1 class="section-title">Statements</h1>
<p class="T1.Text1"><a name="MARKER-9-269"></a>
- A <strong class="Bold"><a
name="MARKER-2-270"></a><dfn>statement</dfn></strong> is a call to a statement
- macro. It begins with the name of a visible binding whose value is a
statement macro. The statement ends
- with the word <code>end</code> optionally followed by the same name that
began the statement. In between
- is a program fragment whose syntax is determined by the macro
definition. Typically this fragment
- includes an optional body; for example, <code>if (ship.ready?)
embark(passenger, ship) end
- if</code>.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-271"></a><dfn>statement
- macro</dfn></strong> can be built-in or user-defined.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-272"></a><dfn>user-defined statement
- macro</dfn></strong> is a macro that defines how to implement a
statement in terms of other
- constructs. Advanced programmers often define new statement macros as
part of structuring a program in a
- readable and modular way.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-273"></a><dfn>built-in statement
- macro</dfn></strong> is like a user-defined statement macro but is
specified as part of the Dylan
- language. There are nine built-in statement macros: <code>begin</code>,
<code>block</code>,
+ A <a name="MARKER-2-270"></a><dfn>statement</dfn> is a call to a
statement macro. It begins
+ with the name of a visible binding whose value is a statement macro. The
statement ends with
+ the word <code>end</code> optionally followed by the same name that
began the statement. In
+ between is a program fragment whose syntax is determined by the macro
definition. Typically
+ this fragment includes an optional body; for example, <code>if
(ship.ready?) embark(passenger,
+ ship) end if</code>.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-271"></a><dfn>statement
macro</dfn> can be built-in or
+ user-defined.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-272"></a><dfn>user-defined
statement macro</dfn> is a
+ macro that defines how to implement a statement in terms of other
constructs. Advanced
+ programmers often define new statement macros as part of structuring a
program in a readable
+ and modular way.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-273"></a><dfn>built-in statement
macro</dfn> is like a
+ user-defined statement macro but is specified as part of the Dylan
language. There are nine
+ built-in statement macros: <code>begin</code>, <code>block</code>,
<code>case</code>, <code>for</code>, <code>if</code>,
<code>select</code>, <code>unless</code>,
<code>until</code>, and <code>while</code>.</p>
<p class="T1.Text1">An implementation can add new kinds of statements as
language extensions. Such a
Modified: trunk/www/books/drm/drm_19.html
==============================================================================
--- trunk/www/books/drm/drm_19.html (original)
+++ trunk/www/books/drm/drm_19.html Sat Dec 10 09:36:29 2005
@@ -125,11 +125,11 @@
<a name="UID-Syntax-1515"></a>
<h1 class="section-title">Parameter Lists</h1>
<p class="T1.Text1">Several Dylan constructs contain
- a <strong class="Bold"><a name="MARKER-2-274"></a><dfn>parameter
list</dfn></strong>, which describes
- the arguments expected by a function and the values returned by that
function. The description includes
- names, types, keyword arguments, fixed or variable number of arguments,
and fixed or variable number of
- values. The argument names specified are locally bound to the values of
the arguments when the function
- is called. The value names specified are only for documentation.</p>
+ a <a name="MARKER-2-274"></a><dfn>parameter list</dfn>, which describes
the arguments expected
+ by a function and the values returned by that function. The description
includes names, types,
+ keyword arguments, fixed or variable number of arguments, and fixed or
variable number of
+ values. The argument names specified are locally bound to the values of
the arguments when the
+ function is called. The value names specified are only for
documentation.</p>
<p class="T1.Text1">The syntactic details of parameter lists are
described
in <a href="drm_118.html#MARKER-9-2115" class="T1.Text1">"Methods" on
page 426</a>.</p>
Modified: trunk/www/books/drm/drm_20.html
==============================================================================
--- trunk/www/books/drm/drm_20.html (original)
+++ trunk/www/books/drm/drm_20.html Sat Dec 10 09:36:29 2005
@@ -124,62 +124,62 @@
<a name="HEADING20-0"></a>
<a name="UID-Syntax-1520"></a>
<h1 class="section-title"><a name="MARKER-2-275"></a>Lexical Syntax</h1>
- <p class="T1.Text1">Dylan source code is a sequence of tokens. <a
name="MARKER-2-276"></a>Whitespace is
- required between tokens if the tokens would otherwise blend together.
Whitespace is optional between
- self-delimiting tokens. Alphabetic case is not significant except within
character and string
- literals.</p>
- <p class="T1.Text1"><strong class="Bold"><a
name="MARKER-2-277"></a><dfn>Whitespace</dfn></strong> can
- be a space character, a tab character, a newline character, or a
comment. Implementations can define
- additional whitespace characters.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-278"></a><dfn>comment</dfn></strong> can be
- single-line or delimited. Although comments count as whitespace, the
beginning of a comment can blend
- with a preceding token, so in general comments should be surrounded by
genuine whitespace.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-279"></a><dfn>single-line
- comment</dfn></strong> consists of two slash characters in a row,
followed by any number of characters
- up to and including the first newline character or the end of the source
record. For
+ <p class="T1.Text1">Dylan source code is a sequence of
+ tokens. <a name="MARKER-2-276"></a>Whitespace is required between tokens
if the tokens would
+ otherwise blend together. Whitespace is optional between self-delimiting
tokens. Alphabetic
+ case is not significant except within character and string literals.</p>
+ <p class="T1.Text1"><a name="MARKER-2-277"></a><dfn>Whitespace</dfn> can
be a space character,
+ a tab character, a newline character, or a comment. Implementations can
define additional
+ whitespace characters.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-278"></a><dfn>comment</dfn> can
be single-line or
+ delimited. Although comments count as whitespace, the beginning of a
comment can blend with a
+ preceding token, so in general comments should be surrounded by genuine
whitespace.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-279"></a><dfn>single-line
comment</dfn> consists of
+ two slash characters in a row, followed by any number of characters up
to and including the
+ first newline character or the end of the source record. For
example, <code><a name="MARKER-2-280"></a>// This line is a
kludge!</code></p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-281"></a><dfn>delimited
- comment</dfn></strong> consists of a slash character immediately
followed by a star character, any
- number of characters (including complete single-line and complete
delimited comments), and finally a
- star character immediately followed by a slash character. For
- example, <code><a name="MARKER-2-282"></a>/* set x to 3 */</code>.</p>
- <p class="T1.Text1">A single-line comment may appear within a delimited
comment; occurrences of
- slash-star or star-slash within the single line comment are ignored.<a
name="MARKER-2-283"></a></p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-284"></a><dfn>token</dfn></strong> is a
- name, a #-word, an operator, a number, a character literal, a string
literal, a symbol literal, or
+ <p class="T1.Text1">A <a name="MARKER-2-281"></a><dfn>delimited
comment</dfn> consists of a
+ slash character immediately followed by a star character, any number of
characters (including
+ complete single-line and complete delimited comments), and finally a
star character
+ immediately followed by a slash character. For example, <code><a
name="MARKER-2-282"></a>/*
+ set x to 3 */</code>.</p>
+ <p class="T1.Text1">A single-line comment may appear within a delimited
comment; occurrences
+ of slash-star or star-slash within the single line comment are
+ ignored.<a name="MARKER-2-283"></a></p>
+ <p class="T1.Text1">A <a name="MARKER-2-284"></a><dfn>token</dfn> is a
name, a #-word, an
+ operator, a number, a character literal, a string literal, a symbol
literal, or
punctuation.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-285"></a><dfn>name</dfn></strong> is one of
- the following four possibilities:</p>
+ <p class="T1.Text1">A <a name="MARKER-2-285"></a><dfn>name</dfn> is one
of the following four
+ possibilities:</p>
<ul>
<li>An alphabetic character followed by zero or more name
characters.</li>
- <li>A numeric character followed by two or more name characters
including at least two alphabetic
- characters in a row.</li>
- <li>A graphic character followed by one or more name characters
including at least one alphabetic
- character.</li>
+ <li>A numeric character followed by two or more name characters
including at least two
+ alphabetic characters in a row.</li>
+ <li>A graphic character followed by one or more name characters
including at least one
+ alphabetic character.</li>
<li>A "\" (backslash) followed by a function operator or another name.
</li>
</ul>
- <p class="Default"><a name="MARKER-2-286"></a>
- An <strong class="Bold"><a name="MARKER-2-287"></a><dfn>alphabetic
character</dfn></strong> is any of
- the 26 letters of the Roman alphabet in upper and lower case.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-288"></a><dfn>numeric
- character</dfn></strong> is any of the 10 digits.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-289"></a><dfn>graphic
- character</dfn></strong> is one of the following:</p>
+ <p class="Default"><a name="MARKER-2-286"></a>An <a
name="MARKER-2-287"></a><dfn>alphabetic
+ character</dfn> is any of the 26 letters of the Roman alphabet in upper
and lower case.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-288"></a><dfn>numeric
character</dfn> is any of the 10
+ digits.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-289"></a><dfn>graphic
character</dfn> is one of the
+ following:</p>
<p class="T1.Text1"> <code>!</code> <code>&</code> <code>*</code>
<code><</code> <code>=</code> <code>></code> <code>|</code>
<code>^</code> <code>$</code> <code>%</code> <code>@</code> <code>_</code></p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-290"></a><dfn>name character</dfn></strong>
- is an alphabetic character, a numeric character, a graphic character, or
one of the following:</p>
+ <p class="T1.Text1">A <a name="MARKER-2-290"></a><dfn>name
character</dfn> is an alphabetic
+ character, a numeric character, a graphic character, or one of the
following:</p>
<p class="T1.Text1"><code>-</code> <code>+</code> <code>~</code>
<code>?</code> <code>/</code></p>
<p class="T1.Text1">The rich set of name characters means that name and
operator tokens can blend. Thus
Dylan programs usually set off operators with whitespace.</p>
<p class="T1.Text1">Implementations can add additional characters but
programs using them will not be
portable.<a name="MARKER-2-291"></a></p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-292"></a><dfn>#-word</dfn></strong> is one
+ <p class="T1.Text1">A <a name="MARKER-2-292"></a><dfn>#-word</dfn> is one
of <code>#t</code>, <code>#f</code>, <code>#next</code>,
<code>#rest</code>, <code>#key</code>,
- or <code>#all-keys</code>. The first two are literal constants, the
others are used in parameter
- lists. Implementations can add additional implementation-defined
#-words, but programmers cannot add
- their own #-words.</p>
- <p class="T1.Text1">An <strong class="Bold"><a
name="MARKER-2-293"></a><dfn>operator</dfn></strong> is
- one of the following:</p>
+ or <code>#all-keys</code>. The first two are literal constants, the
others are used in
+ parameter lists. Implementations can add additional
implementation-defined #-words, but
+ programmers cannot add their own #-words.</p>
+ <p class="T1.Text1">An <a name="MARKER-2-293"></a><dfn>operator</dfn> is
one of the
+ following:</p>
<table>
<tr><td><code>+</code></td><td>addition</td></tr>
<tr><td><code>-</code></td><td>subtraction and negation</td></tr>
@@ -200,23 +200,24 @@
<tr><td><code>~</code></td><td>logical negation</td></tr>
</table>
<p class="T1.Text1">Programmers cannot add their own operators.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-294"></a><dfn>number</dfn></strong> is a
- decimal integer with an optional leading sign, a binary integer, an
octal integer, a hexadecimal
- integer, a ratio of two decimal integers with an optional leading sign,
or a floating-point number. The
- complete syntax of numbers is given in <a
href="drm_117.html#MARKER-9-2105" class="T1.Text1">"Numbers"
- on page 418</a>. Note that the ratios are not included in the Dylan
language. The ratio syntax is
- reserved for future expansion and for implementation-specific
extensions.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-295"></a><dfn>character
- literal</dfn></strong> is a printing character (including space, but not
<code>'</code>
- or <code>\</code>) or a backslash escape sequence enclosed in a pair of
single-quote characters '.</p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-296"></a><dfn>string literal</dfn></strong>
- is a sequence of printing characters (including space, but not
<code>"</code> or <code>\</code>)
- and backslash escape sequences enclosed in a pair of double-quote
characters ".</p>
- <p class="T1.Text1">A <strong class="bold"><a
name="MARKER-2-297"></a><dfn>backslash escape
- sequence</dfn></strong> is a backslash followed by a character or
character code. A backslash escape
- sequence in character and string literals allows quoting of the special
characters ', ", and \,
- provides names for control characters, and allows Unicode characters to
be specified by their
- hexadecimal codes.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-294"></a><dfn>number</dfn> is a
decimal integer with
+ an optional leading sign, a binary integer, an octal integer, a
hexadecimal integer, a ratio
+ of two decimal integers with an optional leading sign, or a
floating-point number. The
+ complete syntax of numbers is given in <a
href="drm_117.html#MARKER-9-2105"
+ class="T1.Text1">"Numbers" on page 418</a>. Note that the ratios are not
included in the Dylan
+ language. The ratio syntax is reserved for future expansion and for
implementation-specific
+ extensions.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-295"></a><dfn>character
literal</dfn> is a printing
+ character (including space, but not <code>'</code> or <code>\</code>) or
a backslash escape
+ sequence enclosed in a pair of single-quote characters '.</p>
+ <p class="T1.Text1">A <a name="MARKER-2-296"></a><dfn>string
literal</dfn> is a sequence of
+ printing characters (including space, but not <code>"</code> or
<code>\</code>) and
+ backslash escape sequences enclosed in a pair of double-quote characters
".</p>
+ <p class="T1.Text1">A <a name="MARKER-2-297"></a><dfn>backslash escape
sequence</dfn> is a
+ backslash followed by a character or character code. A backslash escape
sequence in character
+ and string literals allows quoting of the special characters ', ",
and \, provides names
+ for control characters, and allows Unicode characters to be specified by
their hexadecimal
+ codes.</p>
<p class="T1.Text1">The <a name="MARKER-2-298"></a>control characters
are:</p>
<table>
<tr><td><code>a</code></td><td>alarm</td></tr>
@@ -234,13 +235,12 @@
able to represent the entire Unicode character set, and the number
specifies a character that is not
representable in the implementation, an error must be signaled.</p>
<p class="T1.Text1">For example:
<code>"\<44>\<79>\<6c>\<61>\<6e>" =
"Dylan"</code></p>
- <p class="T1.Text1">A <strong class="Bold"><a
name="MARKER-2-300"></a><dfn>symbol literal</dfn></strong>
- is a keyword or a unique
- string. A <strong class="Bold"><a
name="MARKER-2-301"></a><dfn>keyword</dfn></strong> is a name followed
- immediately by a colon character ":". A <strong class="Bold"><a
name="MARKER-2-302"></a><dfn>unique
- string</dfn></strong> is a sharp sign "#" followed immediately by a
string literal.</p>
- <p class="T1.Text1"><strong class="Bold"><a
name="MARKER-2-303"></a><dfn>Punctuation</dfn></strong> is
- one of the following:</p>
+ <p class="T1.Text1">A <a name="MARKER-2-300"></a><dfn>symbol
literal</dfn> is a keyword or a
+ unique string. A <a name="MARKER-2-301"></a><dfn>keyword</dfn> is a name
followed immediately
+ by a colon character ":". A <a name="MARKER-2-302"></a><dfn>unique
string</dfn> is a sharp
+ sign "#" followed immediately by a string literal.</p>
+ <p class="T1.Text1"><a name="MARKER-2-303"></a><dfn>Punctuation</dfn> is
one of the
+ following:</p>
<table>
<tr><td><code>(</code> <code>)</code></td><td>parentheses</td></tr>
<tr><td><code>[</code> <code>]</code></td><td>square brackets</td></tr>
Modified: trunk/www/books/drm/drm_22.html
==============================================================================
--- trunk/www/books/drm/drm_22.html (original)
+++ trunk/www/books/drm/drm_22.html Sat Dec 10 09:36:29 2005
@@ -127,12 +127,12 @@
<p class="T1.Text1">Dylan's built-in defining macros and special
definitons can only be used at top
level. When the expansion of a user-defined macro includes a call to a
built-in defining macro or
special definition, the user-defined macro also can only be used at top
level.</p>
- <p class="T1.Text1"><a name="MARKER-2-315"></a>A constituent is at
<strong class="Bold"><dfn>top
- level</dfn></strong> if and only if it is a direct constituent of a
body, no preceding constituent of
- that body is a local declaration, and the body is either the body of a
source record or the body of
- a <code>begin</code> statement that is itself a constituent at top
level. When a constituent appears
- inside a call to a macro, whether that constituent is at top level must
be determined after macro
- expansion.</p>
+ <p class="T1.Text1"><a name="MARKER-2-315"></a>A constituent is at
<dfn>top level</dfn> if and
+ only if it is a direct constituent of a body, no preceding constituent
of that body is a local
+ declaration, and the body is either the body of a source record or the
body of
+ a <code>begin</code> statement that is itself a constituent at top
level. When a constituent
+ appears inside a call to a macro, whether that constituent is at top
level must be determined
+ after macro expansion.</p>
<p class="T1.Text1">The effect of the above rule is that a constituent
at top level is not in the scope
of any local declarations, is not subject to any condition handlers
other than default handlers, and is
not affected by any flow of control constructs such as conditionals and
iterations. This restriction
Modified: trunk/www/books/drm/drm_23.html
==============================================================================
--- trunk/www/books/drm/drm_23.html (original)
+++ trunk/www/books/drm/drm_23.html Sat Dec 10 09:36:29 2005
@@ -124,7 +124,11 @@
<a name="HEADING23-0"></a>
<a name="UID-Syntax-1728"></a>
<h1 class="section-title"><a name="MARKER-9-317"></a>Dylan Interchange
Format</h1>
- <p class="T1.Text1">The <strong class="T1.Text1"><a
name="MARKER-2-318"></a>Dylan interchange format</strong> is a standard file
format for publishing Dylan <a name="MARKER-2-319"></a>source code. Such a file
has two parts, the <strong class="Bold"><a name="MARKER-2-320"></a><dfn>file
header</dfn></strong> and the <strong class="Bold"><a
name="MARKER-2-321"></a><dfn>code body</dfn></strong>. The file header comes
before the code body.</p>
+ <p class="T1.Text1">The <a name="MARKER-2-318"></a><dfn>Dylan
interchange format</dfn> is a
+ standard file format for publishing Dylan <a
name="MARKER-2-319"></a>source code. Such a file
+ has two parts, the <a name="MARKER-2-320"></a><dfn>file header</dfn> and
+ the <a name="MARKER-2-321"></a><dfn>code body</dfn>. The file header
comes before the code
+ body.</p>
<p class="T1.Text1">The code body consists of a <a
name="MARKER-2-322"></a>source record.</p>
<p class="T1.Text1">The file header consists of one or more
keyword-value pairs, as follows:</p>
<ul>
Modified: trunk/www/books/drm/drm_24.html
==============================================================================
--- trunk/www/books/drm/drm_24.html (original)
+++ trunk/www/books/drm/drm_24.html Sat Dec 10 09:36:29 2005
@@ -124,11 +124,12 @@
<a name="HEADING24-0"></a>
<a name="UID-Syntax-1171"></a>
<h1 class="section-title"><a name="MARKER-2-330"></a>Naming
Conventions</h1>
- <p class="T1.Text1">Several conventions for naming module bindings help
programmers identify the
- purposes of bindings. In general, the names of <a
name="MARKER-2-331"></a>bindings do not affect the
- semantics of a program, but are simply used to improve <a
name="MARKER-2-332"></a>readability. (The
- exceptions to this rule are the "<code>-definer</code>" suffix used by
definition macros, and the
- "<code>-setter</code>" suffix, described later in this section.)</p>
+ <p class="T1.Text1">Several conventions for naming module bindings help
programmers identify
+ the purposes of bindings. In general, the names of <a
name="MARKER-2-331"></a>bindings do not
+ affect the semantics of a program, but are simply used to
+ improve <a name="MARKER-2-332"></a>readability. (The exceptions to this
rule are the
+ "<code>-definer</code>" suffix used by definition macros, and the
"<code>-setter</code>"
+ suffix, described later in this section.)</p>
<ul>
<li>Module bindings used to hold <a name="MARKER-2-333"></a>types begin
and end
with <a name="MARKER-2-334"></a>angle brackets.</li>
@@ -150,40 +151,41 @@
*machine-state*
*window-count*</pre>
<ul>
- <li>Program <a name="MARKER-2-337"></a>constants begin with a <a
name="MARKER-2-338"></a>dollar
- sign.</li>
+ <li>Program <a name="MARKER-2-337"></a>constants begin with
+ a <a name="MARKER-2-338"></a>dollar sign.</li>
</ul>
<pre class="code">
$pi
$end-of-file</pre>
<ul>
<li>The names of most <a name="MARKER-2-339"></a>predicate functions
end with
- a <a name="MARKER-2-340"></a>question mark. Predicates are functions
that return a true or false
- value.</li>
+ a <a name="MARKER-2-340"></a>question mark. Predicates are functions
that return a true or
+ false value.</li>
</ul>
<pre class="code">
subclass?
even?
instance?</pre>
<ul>
- <li><a name="MARKER-2-341"></a><a name="MARKER-9-342"></a>Operations
that return a value similar to
- one of their arguments and that also destructively modify the argument
end in
- a <code><a name="MARKER-2-343"></a>!</code>. (It will often also be the
case that destructive and
- non-destructive variations of the function exist.) <code>!</code> isn't
a universal warning that an
- operation is destructive. Destructive functions that return other
values (like <code>-setter</code>
- functions and <code>pop</code>) don't need to use the <code>!</code>
convention.</li>
+ <li><a name="MARKER-2-341"></a><a name="MARKER-9-342"></a>Operations
that return a value
+ similar to one of their arguments and that also destructively modify
the argument end in
+ a <code><a name="MARKER-2-343"></a>!</code>. (It will often also be the
case that
+ destructive and non-destructive variations of the function exist.)
<code>!</code> isn't a
+ universal warning that an operation is destructive. Destructive
functions that return other
+ values (like <code>-setter</code> functions and <code>pop</code>) don't
need to use
+ the <code>!</code> convention.</li>
</ul>
<pre class="code">
reverse!
sort!</pre>
<ul>
- <li><a name="MARKER-2-344"></a><a name="MARKER-2-345"></a>Operations
that retrieve a value from a
- location are called <strong><a
name="MARKER-2-346"></a>getters</strong>. Operations that store into a
- location are called <strong><a
name="MARKER-2-347"></a>setters</strong>. In general, getters and
- setters come in pairs. Setter binding names are derived by appending
"<code>-setter</code>" to the
- corresponding getter binding name. This convention is used to generate
setter names automatically, and
- it is used by <code>:=</code>, the assignment operator, to find the
setter that corresponds to a given
- getter.</li>
+ <li><a name="MARKER-2-344"></a><a name="MARKER-2-345"></a>Operations
that retrieve a value
+ from a location are called <a
name="MARKER-2-346"></a><dfn>getters</dfn>. Operations that
+ store into a location are called <a
name="MARKER-2-347"></a><dfn>setters</dfn>. In general,
+ getters and setters come in pairs. Setter binding names are derived by
appending
+ "<code>-setter</code>" to the corresponding getter binding name. This
convention is used to
+ generate setter names automatically, and it is used by <code>:=</code>,
the assignment
+ operator, to find the setter that corresponds to a given getter.</li>
</ul>
<pre class="code">
element element-setter
Modified: trunk/www/books/drm/drm_26.html
==============================================================================
--- trunk/www/books/drm/drm_26.html (original)
+++ trunk/www/books/drm/drm_26.html Sat Dec 10 09:36:29 2005
@@ -115,63 +115,66 @@
<a name="HEADING26-0"></a>
<a name="UID-Program_Structure-2480"></a>
<h1 class="section-title"><a name="MARKER-2-361"></a>Modules</h1>
- <p class="T1.Text1">Modules are used for creating large-scale <a
name="MARKER-2-362"></a>namespaces of
- bindings. The bindings <a name="MARKER-2-363"></a>accessible in a module
- are <a name="MARKER-2-364"></a>visible to all the code within the module
(except where shadowed by a
- local binding). Only the bindings explicitly <a
name="MARKER-2-365"></a>exported are visible from
- outside the module.</p>
- <p class="T1.Text1">Some languages have module systems with distinct
support for exporting variables,
- functions, types, and classes. Dylan modules operate only on bindings.
Because functions and classes are
- commonly named by bindings, access to them is controlled by <a
name="MARKER-2-366"></a>controlling
- access to the bindings that name them. By exporting the binding naming a
class or function, a program
- has effectively exported the class or function. If the binding is not
exported, then the class or
- function is effectively private.<a rel="FOOTNOTE" href="#FOOTNOTE-1"
class="T1.Text1"><sup>[1]</sup></a></p>
- <p class="T1.Text1"><a name="MARKER-2-367"></a>A <a
name="MARKER-2-368"></a>module definition defines
- the imports and exports of a module, and may specify bindings owned by
the module. A complete
- description of module definitions is given on <a
href="drm_112.html#MARKER-9-2016" class="T1.Text1">page
- 381</a>.</p>
+ <p class="T1.Text1">Modules are used for creating
+ large-scale <a name="MARKER-2-362"></a>namespaces of bindings. The
+ bindings <a name="MARKER-2-363"></a>accessible in a module
+ are <a name="MARKER-2-364"></a>visible to all the code within the module
(except where
+ shadowed by a local binding). Only the bindings explicitly <a
name="MARKER-2-365"></a>exported
+ are visible from outside the module.</p>
+ <p class="T1.Text1">Some languages have module systems with distinct
support for exporting
+ variables, functions, types, and classes. Dylan modules operate only on
bindings. Because
+ functions and classes are commonly named by bindings, access to them is
controlled
+ by <a name="MARKER-2-366"></a>controlling access to the bindings that
name them. By exporting
+ the binding naming a class or function, a program has effectively
exported the class or
+ function. If the binding is not exported, then the class or function is
effectively
+ private.<a rel="FOOTNOTE" href="#FOOTNOTE-1"
class="T1.Text1"><sup>[1]</sup></a></p>
+ <p class="T1.Text1"><a name="MARKER-2-367"></a>A <a
name="MARKER-2-368"></a>module definition
+ defines the imports and exports of a module, and may specify bindings
owned by the module. A
+ complete description of module definitions is given on <a
href="drm_112.html#MARKER-9-2016"
+ class="T1.Text1">page 381</a>.</p>
<a name="HEADING26-4"></a>
<a name="UID-Program_Structure-1436"></a>
<h2 class="subsection-title"><a name="MARKER-2-369"></a>Defining Module
Bindings</h2>
<p class="T1.Text1">A module consists of a set of bindings. A binding may
- be <strong class="T1.Text1"><a name="MARKER-2-370"></a>owned</strong> by
a module, or a module
- may <strong class="T1.Text1"><a name="MARKER-2-371"></a>import</strong>
the binding from another module
- by <strong class="T1.Text1"><a name="MARKER-2-372"></a>using</strong>
the other
- module. Modules <strong class="T1.Text1"><a
name="MARKER-2-373"></a>export</strong> bindings to make
- them accessible to other modules. Only exported bindings can be imported
by other modules.</p>
- <p class="T1.Text1">Module-use relationships may not be <a
name="MARKER-2-374"></a>circular. To create a
- common set of bindings for a group of modules, the modules can import
the bindings from another module
- or modules.</p>
- <p class="T1.Text1">Within a given module, a <a
name="MARKER-2-375"></a>name refers to at most one
- module binding. It is an error to create or import two or more different
bindings with the same name in
- a single module. If a name does refer to a binding, the binding is said
to
- be <strong class="T1.Text1"><a
name="MARKER-2-376"></a>accessible</strong> from the module. Each binding
- is owned by exactly one module, but it can be accessible from many
modules.</p>
+ be <a name="MARKER-2-370"></a><dfn>owned</dfn> by a module, or a module
+ may <a name="MARKER-2-371"></a><dfn>import</dfn> the binding from
another module
+ by <a name="MARKER-2-372"></a><dfn>using</dfn> the other
+ module. Modules <a name="MARKER-2-373"></a><dfn>export</dfn> bindings to
make them accessible
+ to other modules. Only exported bindings can be imported by other
modules.</p>
+ <p class="T1.Text1">Module-use relationships may not
+ be <a name="MARKER-2-374"></a>circular. To create a common set of
bindings for a group of
+ modules, the modules can import the bindings from another module or
modules.</p>
+ <p class="T1.Text1">Within a given module, a <a
name="MARKER-2-375"></a>name refers to at most
+ one module binding. It is an error to create or import two or more
different bindings with the
+ same name in a single module. If a name does refer to a binding, the
binding is said to
+ be <a name="MARKER-2-376"></a><dfn>accessible</dfn> from the module.
Each binding is owned by
+ exactly one module, but it can be accessible from many modules.</p>
<p class="T1.Text1">Module <a name="MARKER-2-377"></a>bindings are
created
- by <a name="MARKER-2-378"></a>definitions. <strong class="Bold"><a
name="MARKER-2-379"></a><dfn>Explicit
- definitions</dfn></strong> are created by <code><a
name="MARKER-2-380"></a>define
+ by <a name="MARKER-2-378"></a>definitions. <a
name="MARKER-2-379"></a><dfn>Explicit
+ definitions</dfn> are created by <code><a name="MARKER-2-380"></a>define
constant</code>, <a name="MARKER-2-381"></a><code>define
variable</code>, <a name="MARKER-2-382"></a><code>define
generic</code>, <a name="MARKER-2-383"></a><code>define macro</code> and
the class name
in <a name="MARKER-2-384"></a><code>define
- class</code>. <strong class="Bold"><a
name="MARKER-2-385"></a><dfn>Implicit definitions</dfn></strong>
- are created by <a name="MARKER-2-386"></a><code>define method </code>and
the slot specifications
+ class</code>. <a name="MARKER-2-385"></a><dfn>Implicit definitions</dfn>
are created
+ by <a name="MARKER-2-386"></a><code>define method </code>and the slot
specifications
of <a name="MARKER-2-387"></a><code>define class</code>.</p>
- <p class="T1.Text1">Within a library, a module binding may have no
explicit definition or it may have
- one explicit definition. It may not have more than one explicit
definition. If a module binding has no
- explicit definition, it must have one or more implicit definitions. If
it does have an explicit
- definition, it can have zero or more implicit definitions.</p>
+ <p class="T1.Text1">Within a library, a module binding may have no
explicit definition or it
+ may have one explicit definition. It may not have more than one explicit
definition. If a
+ module binding has no explicit definition, it must have one or more
implicit definitions. If
+ it does have an explicit definition, it can have zero or more implicit
definitions.</p>
<p class="T1.Text1">A binding may be <a name="MARKER-2-388"></a>declared
by
- the <a name="MARKER-2-389"></a><code>create</code> clause of a module
definition. This does not define
- the binding, but instead declares that it is owned by the module. Other
modules may import the binding
- from that module. The binding must be defined by one of the modules that
imports it.</p>
+ the <a name="MARKER-2-389"></a><code>create</code> clause of a module
definition. This does
+ not define the binding, but instead declares that it is owned by the
module. Other modules may
+ import the binding from that module. The binding must be defined by one
of the modules that
+ imports it.</p>
<p class="T1.Text1">If a binding is not declared by the
<code>create</code> clause of a module
- definition, it is owned by the module in which its explicit definition
appears. If it does not have an
- explicit definition, it is owned by one of the modules in which at least
one of its implicit definitions
- appears; the exact owning module cannot be determined.</p>
- <p class="T1.Text1">It is an error to reference a name for the purpose
of getting or setting its value
- if the name does not designate either a local or module binding in the
environment where the reference
- occurs.<a name="MARKER-2-390"></a></p>
+ definition, it is owned by the module in which its explicit definition
appears. If it does not
+ have an explicit definition, it is owned by one of the modules in which
at least one of its
+ implicit definitions appears; the exact owning module cannot be
determined.</p>
+ <p class="T1.Text1">It is an error to reference a name for the purpose
of getting or setting
+ its value if the name does not designate either a local or module
binding in the environment
+ where the reference occurs.<a name="MARKER-2-390"></a></p>
</div>
@@ -179,8 +182,8 @@
<div id="footnotes">
<hr />
- <a name="FOOTNOTE-1"><sup>[1]</sup> </a> This privacy can sometimes be
circumvented through certain
- introspective operations.
+ <a name="FOOTNOTE-1"><sup>[1]</sup></a> This privacy can sometimes be
circumvented through
+ certain introspective operations.
</div>
@@ -190,8 +193,8 @@
<hr class="footer" />
<address class="footer">The Dylan Reference Manual - 7 Apr 1998</address>
<p class="footer"><a class="previous" title="Go to previous page"
href="drm_25.html"><img alt="Previous" src="prev.gif" /></a> <a class="next"
title="Go to next page" href="drm_27.html"><img alt="Next" src="next.gif"
/></a> <a class="up" title="Go to start of chapter" href="drm_25.html"><img
alt="Up" src="up.gif" /></a> <a class="start" title="Go to start of book"
href="drm_1.html"><img alt="Top" src="top.gif" /></a> <a class="contents"
title="Go to table of contents" href="drm_3.html"><img alt="Contents"
src="content.gif" /></a> <a class="index" title="Go to index"
href="drm_127.html"><img alt="index" src="index.gif" /></a></p>
- <p class="footer">Copyright Apple Computer, Inc. 1996. Apple® and
the Apple logo are registered
- trademarks of Apple Computer, Inc. Used with permission. All Rights
Reserved.</p>
+ <p class="footer">Copyright Apple Computer, Inc. 1996. Apple® and
the Apple logo are
+ registered trademarks of Apple Computer, Inc. Used with permission. All
Rights Reserved.</p>
<p class="footer">Originally generated with <a
href="http://www.harlequin.com/webmaker"
class="footer">Harlequin WebMaker®</a>, subsequently revised.</p>
Modified: trunk/www/books/drm/drm_36.html
==============================================================================
--- trunk/www/books/drm/drm_36.html (original)
+++ trunk/www/books/drm/drm_36.html Sat Dec 10 09:36:29 2005
@@ -118,7 +118,7 @@
<a name="HEADING36-0"></a>
<a name="UID-Program_Control-365"></a>
<h1 class="section-title"><a name="MARKER-2-473"></a>Multiple Values</h1>
-<p class="T1.Text1"><a name="MARKER-2-474"></a>The execution of an expression
can yield one value, more than one value, or no values at all. This capability
is called <strong class="T1.Text1">multiple values</strong>.</p>
+<p class="T1.Text1"><a name="MARKER-2-474"></a>The execution of an expression
can yield one value, more than one value, or no values at all. This capability
is called <dfn>multiple values</dfn>.</p>
<p class="T1.Text1">Multiple values are generated by the function <code><a
name="MARKER-2-475"></a>values</code>. <a name="MARKER-2-476"></a>They are
received by the bindings of <a name="MARKER-2-477"></a><code>let</code>
declarations and <a name="MARKER-2-478"></a><code>define constant</code> and <a
name="MARKER-2-479"></a><code>define variable</code> definitions.</p>
<p class="T1.Text1"><a name="MARKER-2-480"></a>Many statements will return
multiple values if the last expression they execute returns multiple values.
Similarly, a function will return all the values of the last subexpression it
executes.</p>
<pre class="code">
Modified: trunk/www/books/drm/drm_40.html
==============================================================================
--- trunk/www/books/drm/drm_40.html (original)
+++ trunk/www/books/drm/drm_40.html Sat Dec 10 09:36:29 2005
@@ -131,7 +131,7 @@
<li><a name="MARKER-2-542"></a>Type objects are immutable.</li>
<li><a name="MARKER-2-543"></a>If two type objects are equivalent and are not
classes, it is unspecified whether they are <code>==</code>.</li>
</ul>
-<p class="T1.Text1"><a name="MARKER-2-544"></a>The following is an informal
description of type relationships: The function <a
name="MARKER-2-545"></a><code>subtype?</code> defines a partial ordering of all
types. Type <var>t<em><sub>1</sub></em></var> is a subtype of type
<var>t<em><sub>2</sub></em></var> (i.e.,
<code>subtype?(<var>t<em><sub>1</sub></em></var>,
<var>t<em><sub>2</sub></em></var>)</code> is true) if it is impossible to
encounter an object that is an instance of <var>t<em><sub>1</sub></em></var>
but not an instance of <var>t<em><sub>2</sub></em></var>. It follows that every
type is a subtype of itself. Two types <var>t<em><sub>1</sub></em></var> and
<var>t<em><sub>2</sub></em></var> are said to be <strong class="Bold"><a
name="MARKER-2-546"></a><dfn>equivalent types</dfn></strong> if
<code>subtype?(<var>t<em><sub>1</sub></em></var>,
<var>t<em><sub>2</sub></em></var>)</cod
e> and <code>subtype?(<var>t<em><sub>2</sub></em></var>,
<var>t<em><sub>1</sub></em></var>
)</code> are both true. <var>t<em><sub>1</sub></em></var> is said to be a
<strong class="Bold"><a name="MARKER-2-547"></a><dfn>proper
subtype</dfn></strong> of <var>t<em><sub>2</sub></em></var> if
<var>t<em><sub>1</sub></em></var> is a subtype of
<var>t<em><sub>2</sub></em></var> and <var>t<em><sub>2</sub></em></var> is not
a subtype of <var>t<em><sub>1</sub></em></var>.</p>
+<p class="T1.Text1"><a name="MARKER-2-544"></a>The following is an informal
description of type relationships: The function <a
name="MARKER-2-545"></a><code>subtype?</code> defines a partial ordering of all
types. Type <var>t<em><sub>1</sub></em></var> is a subtype of type
<var>t<em><sub>2</sub></em></var> (i.e.,
<code>subtype?(<var>t<em><sub>1</sub></em></var>,
<var>t<em><sub>2</sub></em></var>)</code> is true) if it is impossible to
encounter an object that is an instance of <var>t<em><sub>1</sub></em></var>
but not an instance of <var>t<em><sub>2</sub></em></var>. It follows that every
type is a subtype of itself. Two types <var>t<em><sub>1</sub></em></var> and
<var>t<em><sub>2</sub></em></var> are said to be <a
name="MARKER-2-546"></a><dfn>equivalent types</dfn> if
<code>subtype?(<var>t<em><sub>1</sub></em></var>,
<var>t<em><sub>2</sub></em></var>)</code> and <code>subtype?(<var>t<e
m><sub>2</sub></em></var>, <var>t<em><sub>1</sub></em></var>)</code> are both
true. <var>t
<em><sub>1</sub></em></var> is said to be a <a
name="MARKER-2-547"></a><dfn>proper subtype</dfn> of
<var>t<em><sub>2</sub></em></var> if <var>t<em><sub>1</sub></em></var> is a
subtype of <var>t<em><sub>2</sub></em></var> and
<var>t<em><sub>2</sub></em></var> is not a subtype of
<var>t<em><sub>1</sub></em></var>.</p>
<p class="T1.Text1"><code>subtype?</code> on classes is defined by
inheritance. A class is a subtype of itself and of its general superclasses.</p>
<p class="T1.Text1"><code>subtype?</code> on <a
name="MARKER-2-548"></a>singletons is defined by object type and identity. If
<var>x</var> is an object and <var>t</var> is a type,
<code>subtype?(singleton(<var>x</var>), <var>t</var>)</code> will be true only
if <code>instance?(<var>x</var>, <var>t</var>)</code> is true.</p>
<p class="T1.Text1"><code>subtype?</code> rules for union types are given in
<a href="drm_45.html#MARKER-9-701" class="T1.Text1">"Union Types" on page
72</a>. <code>subtype?</code> rules for limited integer types are given in <a
href="drm_46.html#MARKER-9-710" class="T1.Text1">"Limited Integer Types" on
page 74</a>. <code>subtype?</code> rules for limited collection types are given
in <a href="drm_69.html#MARKER-9-1060" class="T1.Text1">"Limited Collection
Types" on page 126</a>.</p>
@@ -140,8 +140,8 @@
<a name="HEADING40-14"></a>
<a name="UID-Types_and_Classes-4914"></a>
<h2 class="subsection-title"><a name="MARKER-2-550"></a>Base Types and
Pseudosubtypes</h2>
-<p class="T1.Text1">Every type has a <strong class="bold"><dfn>base
type</dfn></strong>. The base type for a class is the class itself. The base
type of a singleton is the singleton itself. The base type of a union is the
union of the base types of its component types. The base type of a limited
type <code>limited(<var>C</var>, <var>…</var>)</code> is
<var>C</var>.</p>
-<p class="T1.Text1">The type <var>t<em><sub>1</sub></em></var> is a <strong
class="bold"><dfn>pseudosubtype</dfn></strong> of the type
<var>t<em><sub>2</sub></em></var> if <var>t<em><sub>1</sub></em></var> is a
subtype of the base type of <var>t<em><sub>2</sub></em></var> and
<var>t<em><sub>1</sub></em></var> and <var>t<em><sub>2</sub></em></var> are not
disjoint.</p>
+<p class="T1.Text1">Every type has a <dfn>base type</dfn>. The base type for a
class is the class itself. The base type of a singleton is the singleton
itself. The base type of a union is the union of the base types of its
component types. The base type of a limited type <code>limited(<var>C</var>,
<var>…</var>)</code> is <var>C</var>.</p>
+<p class="T1.Text1">The type <var>t<em><sub>1</sub></em></var> is a
<dfn>pseudosubtype</dfn> of the type <var>t<em><sub>2</sub></em></var> if
<var>t<em><sub>1</sub></em></var> is a subtype of the base type of
<var>t<em><sub>2</sub></em></var> and <var>t<em><sub>1</sub></em></var> and
<var>t<em><sub>2</sub></em></var> are not disjoint.</p>
<p class="T1.Text1">Note that<var> t<em><sub>1</sub></em></var> being a
subtype of <var>t<em><sub>2</sub></em></var> implies that
<var>t<em><sub>1</sub></em></var> is a pseudosubtype of
<var>t<em><sub>2</sub></em></var>, but <var>t<em><sub>1</sub></em></var> being
a pseudosubtype of <var>t<em><sub>2</sub></em></var> does not imply that
<var>t<em><sub>1</sub></em></var> is a subtype of
<var>t<em><sub>2</sub></em></var>. Note also that if
<var>t<em><sub>2</sub></em></var> is not a limited type or some other
nonstandard type, then pseudosubtype is the same as subtype.</p>
<p class="T1.Text1">Base types and pseudosubtypes are used in the rules for
sealing, described in <a href="drm_70.html" class="T1.Text1">Chapter 9,
"Sealing."</a><a name="MARKER-2-551"></a></p>
<a name="HEADING40-19"></a>
Modified: trunk/www/books/drm/drm_41.html
==============================================================================
--- trunk/www/books/drm/drm_41.html (original)
+++ trunk/www/books/drm/drm_41.html Sat Dec 10 09:36:29 2005
@@ -125,18 +125,18 @@
<a name="UID-Types_and_Classes-361"></a>
<h1 class="section-title"><a name="MARKER-2-561"></a>Classes</h1>
<p class="T1.Text1"><a name="MARKER-2-562"></a>Classes are used to define the
inheritance, structure, and initialization of objects.</p>
-<p class="T1.Text1">Every object is a <strong class="Bold"><a
name="MARKER-2-563"></a><dfn>direct instance</dfn></strong> of exactly one
class, and a general instance of the <strong class="Bold"><a
name="MARKER-2-564"></a><dfn>general superclasses</dfn></strong> of that
class.</p>
-<p class="T1.Text1">A class determines which <strong class="T1.Text1"><a
name="MARKER-2-565"></a>slots</strong> its instances have. Slots are the local
storage available within instances. They are used to store the state of
objects.</p>
-<p class="T1.Text1">Classes determine how their instances are initialized by
using the <strong class="bold"><a name="MARKER-2-566"></a><dfn>initialization
protocol</dfn></strong>.</p>
+<p class="T1.Text1">Every object is a <a name="MARKER-2-563"></a><dfn>direct
instance</dfn> of exactly one class, and a general instance of the <a
name="MARKER-2-564"></a><dfn>general superclasses</dfn> of that class.</p>
+<p class="T1.Text1">A class determines which <a
name="MARKER-2-565"></a><dfn>slots</dfn> its instances have. Slots are the
local storage available within instances. They are used to store the state of
objects.</p>
+<p class="T1.Text1">Classes determine how their instances are initialized by
using the <a name="MARKER-2-566"></a><dfn>initialization protocol</dfn>.</p>
<a name="HEADING41-5"></a>
<a name="UID-Types_and_Classes-5438"></a>
<h2 class="subsection-title"><a name="MARKER-2-567"></a>Features of
Classes</h2>
<p class="T1.Text1">There are four features of classes. These features relate
to each other, but can be declared independently.</p>
<ul>
-<li>A class can be <strong class="bold"><a
name="MARKER-2-568"></a><dfn>abstract</dfn></strong> or <strong class="bold"><a
name="MARKER-2-569"></a><dfn>concrete</dfn></strong>. If the class is concrete,
it can have direct instances. If it is abstract, it cannot have direct
instances, but only indirect instances.</li>
-<li>A class can be <strong class="bold"><a
name="MARKER-2-570"></a><dfn>instantiable</dfn></strong> or <strong
class="bold"><a name="MARKER-2-571"></a><dfn>uninstantiable</dfn></strong>. If
the class is instantiable, it can be used as the first argument to
<code>make</code>. If it is uninstantiable, it cannot be used as the first
argument to <code>make</code>.</li>
-<li>A class can be <strong class="bold"><a
name="MARKER-2-572"></a><dfn>primary</dfn></strong> or <strong class="bold"><a
name="MARKER-2-573"></a><dfn>free</dfn></strong>. This controls how a class can
be used for multiple inheritance. For a full description of this feature, see
<a href="drm_73.html#MARKER-9-1106">"Declaring Characteristics of Classes" on
page 134</a>.</li>
-<li>A class can be <strong class="bold"><a
name="MARKER-2-574"></a><dfn>sealed</dfn></strong> or <strong class="bold"><a
name="MARKER-2-575"></a><dfn>open</dfn></strong>. This controls whether a class
can be subclassed outside the library where it is defined. For a full
description of this feature, see <a href="drm_73.html#MARKER-9-1106">"Declaring
Characteristics of Classes" on page 134</a>.<a name="MARKER-2-576"></a></li>
+<li>A class can be <a name="MARKER-2-568"></a><dfn>abstract</dfn> or <a
name="MARKER-2-569"></a><dfn>concrete</dfn>. If the class is concrete, it can
have direct instances. If it is abstract, it cannot have direct instances, but
only indirect instances.</li>
+<li>A class can be <a name="MARKER-2-570"></a><dfn>instantiable</dfn> or <a
name="MARKER-2-571"></a><dfn>uninstantiable</dfn>. If the class is
instantiable, it can be used as the first argument to <code>make</code>. If it
is uninstantiable, it cannot be used as the first argument to
<code>make</code>.</li>
+<li>A class can be <a name="MARKER-2-572"></a><dfn>primary</dfn> or <a
name="MARKER-2-573"></a><dfn>free</dfn>. This controls how a class can be used
for multiple inheritance. For a full description of this feature, see <a
href="drm_73.html#MARKER-9-1106">"Declaring Characteristics of Classes" on page
134</a>.</li>
+<li>A class can be <a name="MARKER-2-574"></a><dfn>sealed</dfn> or <a
name="MARKER-2-575"></a><dfn>open</dfn>. This controls whether a class can be
subclassed outside the library where it is defined. For a full description of
this feature, see <a href="drm_73.html#MARKER-9-1106">"Declaring
Characteristics of Classes" on page 134</a>.<a name="MARKER-2-576"></a></li>
</ul>
<a name="HEADING41-11"></a>
<a name="UID-Types_and_Classes-2532"></a>
@@ -157,23 +157,23 @@
<a name="HEADING41-19"></a>
<a name="UID-Types_and_Classes-5460"></a>
<h2 class="subsection-title"><a name="MARKER-2-582"></a><a
name="MARKER-9-583"></a>Class Inheritance</h2>
-<p class="T1.Text1">When a class is created, its <strong class="bold"><a
name="MARKER-2-584"></a><dfn>direct superclasses</dfn></strong> are specified.
The new class directly inherits from these classes; it is a <strong
class="bold"><a name="MARKER-2-585"></a><dfn>direct subclass</dfn></strong> of
each of these classes. There can be no duplicates in the direct superclasses of
a class.</p>
-<p class="T1.Text1">The subclass relationship is transitive. If a class
<var>C</var> is a direct subclass of <var>C<em><sub>1</sub></em></var>,
<var>C<em><sub>1</sub></em></var> is a direct subclass of
<var>C<em><sub>2</sub></em></var>, and <var>C<em><sub>2</sub></em></var> is a
direct subclass of <var>C<em><sub>3</sub></em></var>, then <var>C</var> is an
<strong class="Bold"><a name="MARKER-2-586"></a><dfn>indirect
subclass</dfn></strong> of <var>C<em><sub>2</sub></em></var> and
<var>C<em><sub>3</sub></em></var>. A <strong class="Bold"><a
name="MARKER-2-587"></a><dfn>general subclass</dfn></strong> is a direct or
indirect subclass.</p>
+<p class="T1.Text1">When a class is created, its <a
name="MARKER-2-584"></a><dfn>direct superclasses</dfn> are specified. The new
class directly inherits from these classes; it is a <a
name="MARKER-2-585"></a><dfn>direct subclass</dfn> of each of these classes.
There can be no duplicates in the direct superclasses of a class.</p>
+<p class="T1.Text1">The subclass relationship is transitive. If a class
<var>C</var> is a direct subclass of <var>C<em><sub>1</sub></em></var>,
<var>C<em><sub>1</sub></em></var> is a direct subclass of
<var>C<em><sub>2</sub></em></var>, and <var>C<em><sub>2</sub></em></var> is a
direct subclass of <var>C<em><sub>3</sub></em></var>, then <var>C</var> is an
<a name="MARKER-2-586"></a><dfn>indirect subclass</dfn> of
<var>C<em><sub>2</sub></em></var> and <var>C<em><sub>3</sub></em></var>. A <a
name="MARKER-2-587"></a><dfn>general subclass</dfn> is a direct or indirect
subclass.</p>
<p class="T1.Text1">Inheritance cannot be <a name="MARKER-2-588"></a>circular.
A class cannot be its own general subclass.</p>
<p class="T1.Text1">A class is a subtype of each of its general
superclasses.</p>
<p class="T1.Text1">Every class is a general subclass of
<code><object></code>.<a name="MARKER-2-589"></a></p>
<a name="HEADING41-25"></a>
<a name="UID-Types_and_Classes-7969"></a>
<h2 class="subsection-title"><a name="MARKER-9-590"></a><a
name="MARKER-2-591"></a>Computing the Class Precedence List</h2>
-<p class="T1.Text1">The definition of a class specifies a <a
name="MARKER-2-592"></a>total ordering on that class and its direct
superclasses. This ordering is called the <strong class="T1.Text1"><a
name="MARKER-2-593"></a>local precedence order</strong>. In the local
precedence order:</p>
+<p class="T1.Text1">The definition of a class specifies a <a
name="MARKER-2-592"></a>total ordering on that class and its direct
superclasses. This ordering is called the <a name="MARKER-2-593"></a><dfn>local
precedence order</dfn>. In the local precedence order:</p>
<ul>
<li>The class precedes its direct superclasses.</li>
<li>Each direct superclass precedes all other direct superclasses that
follow it in the sequence of direct superclasses given in the class
definition.</li>
</ul>
-<p class="T1.Text1">The <strong class="T1.Text1"><a
name="MARKER-2-594"></a>class precedence list</strong> for a class <var>C</var>
is a total ordering on <var>C</var> and its superclasses that is consistent
with the local precedence order of <var>C</var> and with the class precedence
lists of its superclasses. (Two lists are consistent if for every <var>A</var>
and <var>B</var> that are each members of both lists, either <var>A</var>
precedes <var>B</var> in both or <var>B</var> precedes <var>A</var> in both.)
The class precedence list is used in determining the order of specificity of
methods based on the types they are specialized on when dispatching; for
details, see <a href="drm_50.html#MARKER-9-844" class="T1.Text1">"Method
Dispatch" on page 95</a>.</p>
+<p class="T1.Text1">The <a name="MARKER-2-594"></a><dfn>class precedence
list</dfn> for a class <var>C</var> is a total ordering on <var>C</var> and its
superclasses that is consistent with the local precedence order of <var>C</var>
and with the class precedence lists of its superclasses. (Two lists are
consistent if for every <var>A</var> and <var>B</var> that are each members of
both lists, either <var>A</var> precedes <var>B</var> in both or <var>B</var>
precedes <var>A</var> in both.) The class precedence list is used in
determining the order of specificity of methods based on the types they are
specialized on when dispatching; for details, see <a
href="drm_50.html#MARKER-9-844" class="T1.Text1">"Method Dispatch" on page
95</a>.</p>
<p class="T1.Text1">Sometimes there are several such consistent total
orderings on <var>C</var> and its superclasses. Dylan uses a deterministic
algorithm to compute the class precedence list, which chooses one of the
consistent total orderings.</p>
<p class="T1.Text1">Sometimes there is no possible total ordering on
<var>C</var> and its superclasses that is consistent with the local precedence
orders for <var>C</var> and with the class precedence lists of its
superclasses. In this case, the class precedence list cannot be computed, and
an error is signaled.</p>
-<p class="T1.Text1">Note that because the class precedence list for a class is
consistent with the class precedence lists of its superclasses, inheritance in
Dylan is <strong class="bold"><dfn>monotonic</dfn></strong>. That is, if a
generic function call using a direct instance of <var>C</var> dispatches to a
method specialized in that parameter position on an indirect superclass of
<var>C</var>, then there is a direct superclass of <var>C</var> that has the
same behavior.</p>
+<p class="T1.Text1">Note that because the class precedence list for a class is
consistent with the class precedence lists of its superclasses, inheritance in
Dylan is <dfn>monotonic</dfn>. That is, if a generic function call using a
direct instance of <var>C</var> dispatches to a method specialized in that
parameter position on an indirect superclass of <var>C</var>, then there is a
direct superclass of <var>C</var> that has the same behavior.</p>
<p class="T1.Text1">To compute the class precedence list for class
<var>C</var>, merge the local precedence order of the class with the class
precedence lists of the direct superclasses of the class. Computing the class
precedence list for <var>C</var> requires computing the class precedence lists
for its superclasses. This does not lead to infinite recursion because circular
class inheritance is prohibited.</p>
<p class="T1.Text1"><a name="MARKER-2-595"></a>Note that because the class
precedence lists of the direct superclasses are consistent with their local
precedence orders and with the class precedence lists of their direct
superclasses, and so on, the class precedence list for <var>C</var> is
consistent with the local precedence orders and class precedence lists of all
its superclasses and not just the direct superclasses.</p>
<p class="T1.Text1">The merge of several sequences is a sequence that contains
each of the elements of the several input sequences. An element that appears in
more than one of the input sequences appears only once in the output sequence.
If two elements appear in the same input sequence, their order in the output
sequence is the same as their order in that input sequence.</p>
Modified: trunk/www/books/drm/drm_42.html
==============================================================================
--- trunk/www/books/drm/drm_42.html (original)
+++ trunk/www/books/drm/drm_42.html Sat Dec 10 09:36:29 2005
@@ -123,7 +123,7 @@
<a name="UID-Types_and_Classes-2625"></a>
<h1 class="section-title"><a name="MARKER-2-599"></a>Slots</h1>
<p class="T1.Text1">Slots are the interface to information about instances.
They correspond to the <a name="MARKER-2-600"></a>fields or instance variables
of other object-oriented programming languages. By default, each instance of
the class has private storage for each slot, so one instance can have one value
in the slot and another instance can have another value. Some slots are shared
among instances, as described in <a href="#MARKER-9-629" class="T1.Text1">"Slot
Allocation" on page 60</a>.</p>
-<p class="T1.Text1"><a name="MARKER-2-601"></a>All slot access is performed by
function calls.<a rel="FOOTNOTE" href="#FOOTNOTE-2"
class="T1.Text1"><sup>[2]</sup></a> The method that returns the value of a slot
is called the <strong class="Bold"><a name="MARKER-2-602"></a><dfn>getter
method</dfn></strong>, and the method that sets the value of a slot is called
the <strong class="Bold"><a name="MARKER-2-603"></a><dfn>setter
method</dfn></strong>. The getter and setter methods are added to generic
functions. When defining a class, you specify slots by specifying the generic
functions to which the getter and setter methods should be added.</p>
+<p class="T1.Text1"><a name="MARKER-2-601"></a>All slot access is performed by
function calls.<a rel="FOOTNOTE" href="#FOOTNOTE-2"
class="T1.Text1"><sup>[2]</sup></a> The method that returns the value of a slot
is called the <a name="MARKER-2-602"></a><dfn>getter method</dfn>, and the
method that sets the value of a slot is called the <a
name="MARKER-2-603"></a><dfn>setter method</dfn>. The getter and setter methods
are added to generic functions. When defining a class, you specify slots by
specifying the generic functions to which the getter and setter methods should
be added.</p>
<p class="T1.Text1">For example, the class definition for
<code><point></code> might be</p>
<pre class="code">
define class <point> (<object>)
@@ -150,7 +150,7 @@
<p class="T1.Text1">Slots are inherited from superclasses.</p>
<p class="T1.Text1">The collection of all the getter and setter generic
functions for slots specified in a class or inherited from its superclasses
must not contain any duplicates.</p>
<p class="T1.Text1"><a name="MARKER-2-606"></a><a name="MARKER-2-607"></a>If a
superclass is inherited through multiple paths, its slots are inherited once.
For example, if class <var>A</var> has direct superclasses <var>B</var> and
<var>C</var>, and both <var>B</var> and <var>C</var> have <var>D</var> as a
direct superclass, <var>A</var> inherits from <var>D</var> both through
<var>B</var> and through <var>C</var>, but the slots defined by <var>D</var>
are only counted once. Because of this, multiple inheritance does not by itself
create any duplicates among the getters and setters.</p>
-<p class="T1.Text1">Note that two classes that specify a slot with the same
getter or setter generic function are <dfn><a
name="MARKER-2-608">disjoint</a></dfn> —they can never have a common
subclass and no object can be an instance of both classes.<a
name="MARKER-2-609"></a><strong class="T1.Text1"></strong></p>
+<p class="T1.Text1">Note that two classes that specify a slot with the same
getter or setter generic function are <dfn><a
name="MARKER-2-608">disjoint</a></dfn> —they can never have a common
subclass and no object can be an instance of both classes.<a
name="MARKER-2-609"></a></p>
<a name="HEADING42-16"></a>
<a name="UID-Types_and_Classes-1868"></a>
<h2 class="subsection-title"><a name="MARKER-9-610"></a>Slot
Specifications</h2>
@@ -158,7 +158,7 @@
<p class="T1.Text1"><a name="MARKER-2-611"></a>A slot specification must
include the name of the getter of the slot (i.e., the name of the generic
function to which the getter method will be added). This is how slots are
identified. The specification may optionally include the name of the setter
method. If it does not, a default name is generated by appending
"<code>-setter</code>" to the name of the getter.</p>
<p class="T1.Text1">A number of other options are available in slot
specifications:</p>
<ul>
- <li><a name="MARKER-2-612"></a>An initial value for the slot may be
specified with an <strong class="bold"><a name="MARKER-2-613"></a><dfn>init
specification</dfn></strong>.</li>
+ <li><a name="MARKER-2-612"></a>An initial value for the slot may be
specified with an <a name="MARKER-2-613"></a><dfn>init specification</dfn>.</li>
<li><a name="MARKER-2-614"></a>An init-keyword may be specified. This allows
a value for the slot to be supplied when an instance is created.</li>
<li><a name="MARKER-2-615"></a>Slot allocation may be specified. This
controls whether storage for the slot is allocated in each instance, or some
other way. </li>
<li><a name="MARKER-2-616"></a>A slot may be specifed as constant. There
will be no setter for the slot.</li>
@@ -179,17 +179,17 @@
<p class="T0.Text0">An init specification provides a default initial value for
a slot. It can do this directly (if it is an init specification of a slot) or
it can do it indirectly by providing a default value for an init-keyword (if it
is an init specification of an init-keyword).</p>
<p class="T1.Text1">There are three kinds of init specifications:</p>
<ul>
- <li>An <strong class="bold"><a name="MARKER-2-621"></a><dfn>init
value</dfn></strong> specifies a value that is used to initialize the slot.
Each time the slot needs to be initialized, the identical value is used.</li>
- <li>An <strong class="bold"><a name="MARKER-2-622"></a><dfn>init
function</dfn></strong> specifies a function to be called to generate a value
that is used to initialize the slot. Each time the slot needs to be
initialized, the function is called and its value is used. This allows slots to
be initialized to fresh values, or to values computed from the current program
state.</li>
- <li>An <strong class="bold"><a name="MARKER-2-623"></a><dfn>init
expression</dfn></strong> specifies an expression to be executed to generate a
value that is used to initialize the slot. Each time the slot needs to be
initialized, the expression is executed and its value is used. This allows
slots to be initialized to fresh values, or to values computed from the current
program state.</li>
+ <li>An <a name="MARKER-2-621"></a><dfn>init value</dfn> specifies a value
that is used to initialize the slot. Each time the slot needs to be
initialized, the identical value is used.</li>
+ <li>An <a name="MARKER-2-622"></a><dfn>init function</dfn> specifies a
function to be called to generate a value that is used to initialize the slot.
Each time the slot needs to be initialized, the function is called and its
value is used. This allows slots to be initialized to fresh values, or to
values computed from the current program state.</li>
+ <li>An <a name="MARKER-2-623"></a><dfn>init expression</dfn> specifies an
expression to be executed to generate a value that is used to initialize the
slot. Each time the slot needs to be initialized, the expression is executed
and its value is used. This allows slots to be initialized to fresh values, or
to values computed from the current program state.</li>
</ul>
<p class="T1.Text1">Only one init specification may be supplied in a given
slot specification, inherited slot specification, or initialization argument
specification.</p>
<p class="T1.Text1">In general, an <var>init-function</var> will be called and
an <var>init-expression</var> will be executed only if its value will actually
be used.<a name="MARKER-2-624"></a></p>
<a name="HEADING42-37"></a>
<h3 class="sub-subsection-title"><a name="MARKER-2-625"></a>Init-Keywords</h3>
<p class="T1.Text1">An init-keyword allows the value of a slot to be specified
by a keyword argument in the call to <code>make</code> when an instance is
created. An init-keyword may be optional or required.</p>
-<p class="T1.Text1">When the value of a slot is provided by a keyword in a
call to <code>make</code>, it is called an <strong class="bold"><a
name="MARKER-2-626"></a><dfn>initialization argument</dfn></strong>.</p>
-<p class="T1.Text1">If an init-keyword is specified, the slot is said to be
<strong class="Bold"><a name="MARKER-2-627"></a><dfn>keyword
initializable</dfn></strong>.</p>
+<p class="T1.Text1">When the value of a slot is provided by a keyword in a
call to <code>make</code>, it is called an <a
name="MARKER-2-626"></a><dfn>initialization argument</dfn>.</p>
+<p class="T1.Text1">If an init-keyword is specified, the slot is said to be <a
name="MARKER-2-627"></a><dfn>keyword initializable</dfn>.</p>
<a name="HEADING42-41"></a>
<h3 class="sub-subsection-title"><a name="MARKER-2-628"></a><a
name="MARKER-9-629"></a>Slot Allocation</h3>
<p class="T1.Text1">Options for slot allocation include <code><a
name="MARKER-2-630"></a>instance</code>, <a
name="MARKER-2-631"></a><code>class</code>, <a
name="MARKER-2-632"></a><code>each-subclass</code>, and <code><a
name="MARKER-2-633"></a>virtual</code>.</p>
Modified: trunk/www/books/drm/drm_43.html
==============================================================================
--- trunk/www/books/drm/drm_43.html (original)
+++ trunk/www/books/drm/drm_43.html Sat Dec 10 09:36:29 2005
@@ -131,7 +131,7 @@
<ul>
<li>The program calls <code>make</code> specifying a class and a set of
keyword arguments.</li>
<li>Optionally, the default <code>make</code> method may be shadowed by a
user-supplied method specialized with a singleton specializer. This enables the
user method to get at all the arguments to <code>make</code>, and to provide
actual instantiation and initializations based on them. For example, a
singleton method on an <a name=" |