Programming Language Design Concepts David Anthony Watt Download
Programming Language Design Concepts David Anthony Watt Download
https://ebookbell.com/product/programming-language-design-
concepts-david-anthony-watt-50867308
https://ebookbell.com/product/design-concepts-in-programming-
languages-franklyn-a-turbak-david-k-gifford-32792606
https://ebookbell.com/product/programming-language-design-and-
implementation-torben-gidius-mogensen-48673784
https://ebookbell.com/product/programming-language-design-and-
implementation-torben-gidius-mogensen-49157980
https://ebookbell.com/product/eiffel-analysis-design-and-programming-
language-second-edition-4090312
Javascript Programming For Beginners Python What Are The Benefits Of
Javascript Javascript For Web Design Why Is Python A Preferred
Language For Startups Malina Pronto
https://ebookbell.com/product/javascript-programming-for-beginners-
python-what-are-the-benefits-of-javascript-javascript-for-web-design-
why-is-python-a-preferred-language-for-startups-malina-
pronto-232322300
https://ebookbell.com/product/programmingbased-formal-languages-and-
automata-theory-design-implement-validate-and-prove-marco-t-
morazn-58295988
https://ebookbell.com/product/programming-language-theory-and-formal-
methods-zoran-gacovski-50288082
https://ebookbell.com/product/programming-language-theory-alvin-
albuero-de-luna-50288106
David A. Watt
with contributions by
William Findlay
Programming
PROGRAMMING LANGUAGE
DESIGN CONCEPTS
WITHDRAWN
*tvT£STTYOF
PORTSMOUTH Ubsary
All Rights Reserved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in
any form or by any means, electronic, mechanical, photocopying, recording, scanning or otherwise, except under
the terms of the Copyright, Designs and Patents Act 1988 or under the terms of a licence issued by the Copyright
Licensing Agency Ltd, 90 Tottenham Court Road, London WIT 4LP, UK, without the permission in writing of the
Publisher, with the exception of any material supplied specifically for the purpose of being entered and executed
on a computer system for exclusive use by the purchase of the publication. Requests to the Publisher should be
addressed to the Permissions Department, John Wiley & Sons Ltd, The Atrium, Southern Gate, Chichester, West
Sussex P019 8SQ, England, or emailed to [email protected], or faxed to (+44) 1243 770620.
This publication is designed to provide accurate and authoritative information in regard to the subject matter
covered. It is sold on the understanding that the Publisher is not engaged in rendering professional services. If
professional advice or other expert assistance is required, the services of a competent professional should be sought.
John Wiley & Sons Inc., Ill River Street, Hoboken, NJ 07030, USA
John Wiley & Sons Australia Ltd, 33 Park Road, Milton, Queensland 4064, Australia
John Wiley & Sons (Asia) Pte Ltd, 2 dementi Loop #02-01, Jin Xing Distripark, Singapore 129809
John Wiley & Sons Canada Ltd, 22 Worcester Road, Etobicoke, Ontario, Canada M9W 1L1
Wiley also publishes its books in a variety of electronic formats. Some content that appears
in print may not be available in electronic books.
A catalogue record for this book is available from the British Library
Preface xv
Part I: Introduction 1
1 Programming languages 3
1.1 Programming linguistics 3
1.1.1 Concepts and paradigms 3
1.1.2 Syntax, semantics, and pragmatics 5
1.1.3 Language processors 6
1.2 Historical development 6
Summary 10
Further reading 10
Exercises 10
vii
VIII Contents
Summary 328
Further reading 328
Exercises 329
16 Scripting 413
16.1 Pragmatics 413
16.2 Key concepts 414
16.2.1 Regular expressions 415
16.3 Case study: Python 417
16.3.1 Values and types 418
16.3.2 Variables, storage, and control 419
16.3.3 Bindings and scope 421
16.3.4 Procedural abstraction 421
16.3.5 Data abstraction 422
16.3.6 Separate compilation 424
16.3.7 Module library 425
Summary 427
Further reading 427
Exercises 427
Bibliography 449
Glossary 453
Index 465
Preface
The first programming language I ever learned was Algol60. This language was
notable for its elegance and its regularity; for all its imperfections, it stood head and
shoulders above its contemporaries. My interest in languages was awakened, and
I began to perceive the benefits of simplicity and consistency in language design.
Since then I have learned and programmed in about a dozen other languages,
and I have struck a nodding acquaintance with many more. Like many pro¬
grammers, I have found that certain languages make programming distasteful, a
drudgery; others make programming enjoyable, even esthetically pleasing. A good
language, like a good mathematical notation, helps us to formulate and communi¬
cate ideas clearly. My personal favorites have been Pascal, Ada, ML, and Java.
Each of these languages has sharpened my understanding of what programming
is (or should be) all about. Pascal taught me structured programming and data
types. Ada taught me data abstraction, exception handling, and large-scale pro¬
gramming. ML taught me functional programming and parametric polymorphism.
Java taught me object-oriented programming and inclusion polymorphism. I had
previously met all of these concepts, and understood them in principle, but I did
not truly understand them until I had the opportunity to program in languages
that exposed them clearly.
Contents
This book consists of five parts.
Chapter 1 introduces the book with an overview of programming linguistics
(the study of programming languages) and a brief history of programming and
scripting languages.
Chapters 2-5 explain the basic concepts that underlie almost all programming
languages: values and types, variables and storage, bindings and scope, procedures
and parameters. The emphasis in these chapters is on identifying the basic
concepts and studying them individually. These basic concepts are found in almost
all languages.
Chapters 6-10 continue this theme by examining some more advanced con¬
cepts: data abstraction (packages, abstract types, and classes), generic abstraction
(or templates), type systems (inclusion polymorphism, parametric polymor¬
phism, overloading, and type conversions), sequencers (including exceptions), and
concurrency (primitives, conditional critical regions, monitors, and rendezvous).
These more advanced concepts are found in the more modern languages.
Chapters 11-16 survey the most important programming paradigms, compar¬
ing and contrasting the long-established paradigm of imperative programming
with the increasingly important paradigms of object-oriented and concurrent pro¬
gramming, the more specialized paradigms of functional and logic programming,
and the paradigm of scripting. These different paradigms are based on different
xv
xvi Preface
selections of key concepts, and give rise to sharply contrasting styles of language
and of programming. Each chapter identifies the key concepts of the subject
paradigm, and presents an overview of one or more major languages, showing
how concepts were selected and combined when the language was designed.
Several designs and implementations of a simple spellchecker are presented to
illustrate the pragmatics of programming in all of the major languages.
Chapters 17 and 18 conclude the book by looking at two issues: how to select
a suitable language for a software development project, and how to design a
new language.
The book need not be read sequentially. Chapters 1-5 should certainly be
read first, but the remaining chapters could be read in many different orders.
Chapters 11-15 are largely self-contained; my recommendation is to read at least
some of them after Chapters 1-5, in order to gain some insight into how major
languages have been designed. Figure P.l summarizes the dependencies between
the chapters.
Exercises
Readership
All programmers, not just language specialists, need a thorough understanding
of language concepts. This is because programming languages are our most
fundamental tools. They influence the very way we think about software design
and implementation, about algorithms and data structures.
This book is aimed at junior, senior, and graduate students of computer
science and information technology, all of whom need some understanding of
the fundamentals of programming languages. The book should also be of inter¬
est to professional software engineers, especially project leaders responsible
for language evaluation and selection, designers and implementers of language
processors, and designers of new languages and of extensions to existing languages.
To derive maximum benefit from this book, the reader should be able to
program in at least two contrasting high-level languages. Language concepts can
best be understood by comparing how they are supported by different languages. A
reader who knows only a language like C, C++, or Java should learn a contrasting
language such as Ada (or vice versa) at the same time as studying this book.
The reader will also need to be comfortable with some elementary concepts
from discrete mathematics - sets, functions, relations, and predicate logic - as
these are used to explain a variety of language concepts. The relevant mathematical
concepts are briefly reviewed in Chapters 2 and 15, in order to keep this book
reasonably self-contained.
This book attempts to cover all the most important aspects of a large subject.
Where necessary, depth has been sacrificed for breadth. Thus the really serious
xviii Preface
student will need to follow up with more advanced studies. The book has an
extensive bibliography, and each chapter closes with suggestions for further
reading on the topics covered by the chapter.
Acknowledgments
Bob Tennent’s classic book Programming Language Principles has profoundly
influenced the way I have organized this book. Many books on programming
languages have tended to be syntax-oriented, examining several popular languages
feature by feature, without offering much insight into the underlying concepts
or how future languages might be designed. Some books are implementation-
oriented, attempting to explain concepts by showing how they are implemented
on computers. By contrast, Tennent’s book is semantics-oriented, first identifying
and explaining powerful and general semantic concepts, and only then analyzing
particular languages in terms of these concepts. In this book I have adopted Ten¬
nent’s semantics-oriented approach, but placing far more emphasis on concepts
that have become more prominent in the intervening two decades.
I have also been strongly influenced, in many different ways, by the work
of Malcolm Atkinson, Peter Buneman, Luca Cardelli, Frank DeRemer, Edsger
Dijkstra, Tony Hoare, Jean Ichbiah, John Hughes, Mehdi Jazayeri, Bill Joy, Robin
Milner, Peter Mosses, Simon Peyton Jones, Phil Wadler, and Niklaus Wirth.
I wish to thank Bill Findlay for the two chapters (Chapters 10 and 13) he has
contributed to this book. His expertise on concurrent programming has made this
book broader in scope than I could have made it myself. His numerous suggestions
for my own chapters have been challenging and insightful.
Last but not least, I would like to thank the Wiley reviewers for their
constructive criticisms, and to acknowledge the assistance of the Wiley editorial
staff led by Gaynor Redvers-Mutton.
David A. Watt
Brisbane
March 2004
PART I
INTRODUCTION
Programming languages
3
4 Chapter 1 Programming languages
Just as important as the individual concepts are the ways in which they may
be put together to design complete programming languages. Different selections
of key concepts support radically different styles of programming, which are
called paradigms. There are six major paradigms. Imperative programming is
characterized by the use of variables, commands, and procedures; object-oriented
programming by the use of objects, classes, and inheritance; concurrent pro¬
gramming by the use of concurrent processes, and various control abstractions;
functional programming by the use of functions; logic programming by the use of
relations; and scripting languages by the presence of very high-level features. We
shall study all of these paradigms in Part IV of this book.
1960
1970
1980
1990
2000
Cobol was another early major high-level language. Its most important
contribution was the concept of data descriptions, a forerunner of today’s data
types. Like Fortran, Cobol’s control flow was fairly low-level. Also like Fortran,
Cobol has developed a long way from its original design, the latest version being
standardized in 2002.
Algol60 was the first major programming language to be designed for
communicating algorithms, not just for programming a computer. Algol60 intro¬
duced the concept of block structure, whereby variables and procedures could
be declared wherever in the program they were needed. It was also the first
major programming language to support recursive procedures. Algol60 influ¬
enced numerous successor languages so strongly that they are collectively called
ALGOL-like languages.
Fortran and Algol60 were most useful for numerical computation, and
Cobol for commercial data processing. PL/I was an attempt to design a
general-purpose programming language by merging features from all three. On
8 Chapter 1 Programming languages
top of these it introduced many new features, including low-level forms of excep¬
tions and concurrency. The resulting language was huge, complex, incoherent,
and difficult to implement. The PL/I experience showed that simply piling feature
upon feature is a bad way to make a programming language more powerful and
general-purpose.
A better way to gain expressive power is to choose an adequate set of concepts
and allow them to be combined systematically. This was the design philosophy
of Algol68. For instance, starting with concepts such as integers, arrays, and
procedures, the Algol68 programmer can declare an array of integers, an array of
arrays, or an array of procedures; likewise, the programmer can define a procedure
whose parameter or result is an integer, an array, or another procedure.
Pascal, however, turned out to be the most popular of the ALGOL-like
languages. It is simple, systematic, and efficiently implementable. Pascal and
Algol68 were among the first major programming languages with both a rich
variety of control structures (conditional and iterative commands) and a rich
variety of data types (such as arrays, records, and recursive types).
C was originally designed to be the system programming language of the Unix
operating system. The symbiotic relationship between C and Unix has proved very
good for both of them. C is suitable for writing both low-level code (such as the
Unix system kernel) and higher-level applications. However, its low-level features
are easily misused, resulting in code that is unportable and unmaintainable.
Pascal’s powerful successor, Ada, introduced packages and generic units -
designed to aid the construction of large modular programs - as well as high-level
forms of exceptions and concurrency. Like PL/I, Ada was intended by its designers
to become the standard general-purpose programming language. Such a stated
ambition is perhaps very rash, and Ada also attracted a lot of criticism. (For
example, Tony Hoare quipped that Pascal, like Algol60 before it, was a marked
advance on its successors!) The critics were wrong: Ada was very well designed,
is particularly suitable for developing high-quality (reliable, robust, maintainable,
efficient) software, and is the language of choice for mission-critical applications
in fields such as aerospace.
We can discern certain trends in the history of programming languages. One
has been a trend towards higher levels of abstraction. The mnemonics and symbolic
labels of assembly languages abstract away from operation codes and machine
addresses. Variables and assignment abstract away from inspection and updating
of storage locations. Data types abstract away from storage structures. Control
structures abstract away from jumps. Procedures abstract away from subroutines.
Packages achieve encapsulation, and thus improve modularity. Generic units
abstract procedures and packages away from the types of data on which they
operate, and thus improve reusability.
Another trend has been a proliferation of paradigms. Nearly all the languages
mentioned so far have supported imperative programming, which is characterized
by the use of commands and procedures that update variables. PL/I and Ada sup¬
port concurrent programming, characterized by the use of concurrent processes.
However, other paradigms have also become popular and important.
1.2 Historical development 9
script that will later be called whenever required. An office system (such as a word
processor or spreadsheet system) might enable the user to store a script (“macro”)
embodying a common sequence of commands, typically written in Visual Basic.
The Internet has created a variety of new niches for scripting. For example, the
results of a database query might be converted to a dynamic Web page by a script,
typically written in Perl. All these applications are examples of scripting. Scripts
(“programs” written in scripting languages) typically are short and high-level, are
developed very quickly, and are used to glue together subsystems written in other
languages. So scripting languages, while having much in common with imperative
programming languages, have different design constraints. The most modern and
best-designed of these scripting languages is Python.
Summary
In this introductory chapter:
• We have seen what is meant by programming linguistics, and the topics encompassed
by this term: concepts and paradigms; syntax, semantics, and pragmatics; and
language processors.
• We have briefly surveyed the history of programming languages. We saw how new
languages inherited successful concepts from their ancestors, and sometimes intro¬
duced new concepts of their own. We also saw how the major paradigms evolved:
imperative programming, object-oriented programming, concurrent programming,
functional programming, logic programming, and scripting.
Further reading
Programming language concepts and paradigms are cov¬ in Wexelblat (1980). Comparative studies of program¬
ered not only in this book, but also in Tennent (1981), ming languages may be found in Horowitz (1995), Pratt
Ghezzi and Jazayeri (1997), Sebesta (2001), and Sethi and Zelcowitz (2001), and Sebesta (2001). A survey
(1996). Programming language syntax and semantics are of scripting languages may be found in Barron
covered in Watt (1991). Programming language proces¬ (2000).
sors are covered in Aho et al. (1986), Appel (1998), and
Watt and Brown (2000).
More detailed information on the programming languages
The early history of programming languages (up to the mentioned in this chapter may be found in the references
1970s) was the theme of a major conference, reported cited in Table 1.1.
Exercises
Note: Harder exercises are marked *.
1.1.1 Here is a whimsical exercise to get you started. For each programming language
that you know, write down the shortest program that does nothing at all.
How long is this program? This is quite a good measure of the programming
language’s verbosity!
Exercises 1 1
Programming
language Description
BASIC CONCEPTS
Part II explains the more elementary programming language concepts, which are
supported by almost all programming languages:
13
Chapter 2
Data are the raw material of computation, and are just as important (and valuable) as the
programs that manipulate the data. In computer science, therefore, the study of data is
considered as an important topic in its own right.
In this chapter we shall study:
(In Chapter 3 we shall go on to study how values may be stored, and in Chapter 4 how
values may be bound to identifiers.)
2.1 Types
A value is any entity that can be manipulated by a program. Values can be
evaluated, stored, passed as arguments, returned as function results, and so on.
Different programming languages support different types of values:
Most programming languages group values into types. For instance, nearly
all languages make a clear distinction between integer and real numbers. Most
15
16 Chapter 2 Values and types
languages also make a clear distinction between booleans and integers: integers
can be added and multiplied, while booleans can be subjected to operations like
not, and, and or.
What exactly is a type? The most obvious answer, perhaps, is that a type is a
set of values. When we say that v is a value of type T, we mean simply that v e T.
When we say that an expression E is of type T, we are asserting that the result of
evaluating E will be a value of type T.
However, not every set of values is suitable to be regarded as a type. We insist
that each operation associated with the type behaves uniformly when applied to all
values of the type. Thus {false, true} is a type because the operations not, and, and or
operate uniformly over the values false and true. Also, {..., —2, —1, 0, +1, +2,...}
is a type because operations such as addition and multiplication operate uniformly
over all these values. But {13, true, Monday} is not a type, since there are no useful
operations over this set of values. Thus we see that a type is characterized not only
by its set of values, but also by the operations over that set of values.
Therefore we define a type to be a set of values, equipped with one or more
operations that can be applied uniformly to all these values.
Every programming language supports both primitive types, whose values are
primitive, and composite types, whose values are composed from simpler values.
Some languages also have recursive types, a recursive type being one whose
values are composed from other values of the same type. We examine primitive,
composite, and recursive types in the next three sections.
One or more primitive types are built-in to every programming language. The
choice of built-in primitive types tells us much about the programming language’s
intended application area. Languages intended for commercial data processing
(such as Cobol) are likely to have primitive types whose values are fixed-length
strings and fixed-point numbers. Languages intended for numerical computation
(such as Fortran) are likely to have primitive types whose values are real
numbers (with a choice of precisions) and perhaps also complex numbers. A
language intended for string processing (such as Snobol) is likely to have a
primitive type whose values are strings of arbitrary length.
Nevertheless, certain primitive types crop up in a variety of languages, often
under different names. For example, Java has boolean, char, int, and float,
whereas Ada has Boolean, Character, Integer, and Float. These name
differences are of no significance. For the sake of consistency, we shall use Boolean,
2.2 Primitive types 17
Character, Integer, and Float as names for the most common primitive types:
C++ also provide a variety of integer types, but they are implementation-
defined.
• Some languages provide not one but several floating-point types. For
example, C, C++, and Java provide both float and double, of which the
latter provides greater range and precision.
int countryPop;
long worldPop;
The variable countryPop could be used to contain the current population of any country
(since no country yet has a population exceeding 2 billion). The variable worldPop could
be used to contain the world’s total population. But note that the program would fail if
worldPop’s type were int rather than long (since the world’s total population now
exceeds 6 billion).
A C++ program with the same declarations would be unportable: a C++ compiler may
choose {—65 536,..., +65 535} as the set of int values!
countryPop: Population;
worldPop: Population;
The integer type defined here has the following set of values:
This code is completely portable - provided only that the computer is capable of
supporting the specified range of integers.
Month = [jan, feb, mar, apr, may, jun, jul, aug, sep, oct, nov, dec}
#Month = 12
The enumerands of type Month are distinct from the values of any other type. Note
that we must carefully distinguish between these enumerands (which for convenience we
have written as jan, feb, etc.) and the identifiers that denote them in the program (j an,
feb, etc.). This distinction is necessary because the identifiers might later be redeclared.
(For example, we might later redeclare dec as a procedure that decrements an integer; but
the enumerand dec still exists and can be computed.)
By contrast, the C++ type definition:
defines Month to be an integer type, and binds j an to 0, feb to 1, and so on. Thus:
The indices of the array freq are values of type Character. Likewise, the loop control
variable ch takes a sequence of values of type Character.
Also consider the following Ada code:
The indices of the array length are values of type Month. Likewise, the loop control
variable mth takes a sequence of values of type Month.
Most programming languages allow only integers to be used for counting and
array indexing. C and C++ allow enumerands also to be used for counting and
array indexing, since they classify enumeration types as integer types.
(For sequential files, direct files, and relations see Exercise 2.3.6.)
We discuss Cartesian products, mappings, and disjoint unions in this section,
and recursive types in Section 2.4. Each programming language provides its own
notation for describing composite types. Here we shall use mathematical notation
2.3 Composite types 21
that is concise, standard, and suitable for defining sets of values structured as
Cartesian products, mappings, and disjoint unions.
f > • • •
(k, a) (it, b) (it, c)
• • X • • • =
U V a b c • • •
V_> \___^ (v, a) (v, b) (v, c)
Figure 2.1 Cartesian product of
SxT sets S and T.
22 Chapter 2 Values and types
Here someday, m selects the first component, and someday, d the second component,
of the record someday. Note that the use of component identifiers m and d in record
construction and selection enables us to write code that does not depend on the order of
the components.
This type models dates even more crudely than its Ada counterpart in Example 2.5.
The following code illustrates structure construction:
A special case of a Cartesian product is one where all tuple components are
chosen from the same set. The tuples in this case are said to be homogeneous.
For example:
S2 — S x S (2.9)
means the set of homogeneous pairs whose components are both chosen from set
S. More generally we write:
Sn = Sx ...xS (2.10)
to mean the set of homogeneous n-tuples whose components are all chosen from
set S.
The cardinality of a set of homogeneous n-tuples is given by:
to state that m is a mapping from set S to set T. In other words, m maps every
value in S to a value in T. (Read the symbol as “maps to”.)
If m maps value x in set S to value y in set T, we write y = m(x). The value y
is called the image of x under m.
Two different mappings from S = {u, v} to T = [a, b, c} are illustrated in
Figure 2.2. We use notation such as {u —> a, v -> c} to denote the mapping that
maps u to a and v to c.
The notation S -+ T stands for the set of all mappings from S to T. Formally:
S^T={m\xeS=3> m(x) e Tj (2.14)
This is illustrated in Figure 2.3.
Let us deduce the cardinality of S -> T. Each value in S has #T possible
images under a mapping in S T. There are #S such values in S. Therefore there
24 Chapter 2 Values and types
• •
U V
bool p[3];
2.3 Composite types 25
The indices of this array range from the lower bound 0 to the upper bound 2. The set of
possible values of this array is therefore:
{0 -> false, 1 -> false, 2 -+ false} {0 -* true, 1 —>■ false, 2 —> false}
(0 -* false, 1 -> false, 2 —true} {0 -+ true, 1 -+ false, 2 -> true}
{0 —» false, 1 —> true, 2 —> false} (0 -» true, 1 -+ true, 2 -> false}
{0 ->• false, 1 -* true, 2 -» true} {0 -> true, 1 -4- true, 2 -+ true}
The following code illustrates array indexing (using an int variable c):
p[c] = !p[c];
#Pixel = (#Boolean)#Color = 23 = 8
{red -*■ false, green -*■ false, blue -> false} {red true, green —> false, blue -+ false}
{red —> false, green -* false, blue -+ true} {red —r true, green —>■ false, blue —> true}
{red —r false, green -* true, blue —> false} {red -+ true, green —> true, blue -+ false}
{red —> false, green -*■ true, blue —> true} {red —> true, green -» true, blue -+ true}
p: Pixel :=
(red => true, green => false, blue => true);
26 Chapter 2 Values and types
or more concisely:
The following code illustrates array indexing (using a Color variable c):
Window = Yrange x Xrange -> Pixel = (0,..., 255} x {0,..., 511} -+- Pixel
An array of this type is indexed by a pair of integers. Thus w(8,12) accesses that
component of w whose index is the pair (8,12).
while (m > 1) m -= 2;
return (m == 0);
>
>
implements a particular mapping in Float x Integer -* Float. Presumably, it maps the pair
(1.5, 2) to 2.25, the pair (4.0, —2) to 0.0625, and so on.
r \
f N r > • •
— left u left v
• • + • • •
U V a b c • • •
right a right b right c.
Figure 2.4 Disjoint union of sets
S + T (or left S + right T) S and T.
2.3 Composite types 29
rounded num =
-- Return the result of rounding the number num to the nearest integer,
case num of
Exact i -> i
Inexact r -> round r
This uses pattern matching. If the value of num is Inexact 3.1416, the pattern “Inexact
r” matches it, r is bound to 3.1416, and the subexpression “round r” is evaluated,
yielding 3.
A discriminated record’s tag and variant components are selected in the same
way as ordinary record components. When a variant such as rval is selected,
a run-time check is needed to ensure that the tag is currently inexact. The
safest way to select from a discriminated record is by using a case command, as
illustrated in Example 2.13.
In general, discriminated records may be more complicated. A given variant
may have any number of components, not necessarily one. Moreover, there may
be some components that are common to all variants.
Each value in Figure is a tagged tuple. The first and second components of each tuple
(named x and y) are common to all variants. The remaining components depend on the
tag. When the tag is pointy, there are no other components. When the tag is circular,
there is one other component (named r). When the tag is rectangular, there are two other
components (named w and h).
class Point {
private float x, y;
// methods
}
class Circle extends Point {
private float r;
// methods
}
class Rectangle extends Point {
private float w, h;
// methods
}
Objects of these classes represent points, circles, and rectangles on the xy plane, respecti¬
vely. The Circle class extends (is a subclass of) the Point class, so Circle objects
inherit components x and y from Point, as well as having their own component r.
The Rectangle class likewise extends the Point class, so Rectangle objects inherit
components x and y from Point, as well as having their own components w and h.
The set of objects of this program is:
Point(Float x Float)
+ Circle^Float x Float x Float)
+ Rectanglei Float x Float x Float x Float)
+...
Here “+...” reminds us that the set of objects is open-ended. The following class
declaration:
class Date {
private int m, d;
32 Chapter 2 Values and types
Compare Example 2.15 with Example 2.14. The important difference is that
the set of objects in a program is open-ended, and can be augmented at any time
simply by defining a new class (not necessarily related to existing classes). This
open-endedness helps to explain the power of object-oriented programming.
It is important not to confuse disjoint union with ordinary set union. The tags
in a disjoint union S + T allow us to test whether the variant was chosen from
S or T. This is not necessarily the case in the ordinary union S U T. In fact, if
T — {a, b, c}, then:
TUT = {a, b, c} — T
T + T — {left a, left b, left c, right a, right b, right c} ^ T
The unions of C and C++ are not disjoint unions, since they have no tags. This
obviously makes tag test impossible, and makes projection unsafe. In practice,
therefore, C programmers enclose each union within a structure that also contains
a tag.
union Untagged_Number {
int ival;
float rval;
};
The set of values of this union type is:
Accuracy acc;
union {
inf ival; /* used when acc contains exact */
float rval; /* used when acc contains inexact */
> content;
This structure crudely models a disjoint union, but it is very error-prone. The programmer’s
intentions are indicated by the comments, but only great care and self-discipline by the
programmer can ensure that the structure is used in the way intended.
2.4.1 Lists
• length
• emptiness test
• head selection (i.e., selection of the list’s first component)
• tail selection (i.e., selection of the list consisting of all but the first
component)
• concatenation.
Suppose that we wish to define a type of integer-lists, whose values are lists
of integers. We may define an integer-list to be a value that is either empty or
a pair consisting of an integer (its head) and a further integer-list (its tail). This
definition is recursive. We may write this definition as a set equation:
where we have chosen the tags nil for an empty list and cons for a nonempty list.
Henceforth we shall abbreviate nil{) to nil.
Equations (2.19) and (2.20) are recursive, like our informal definition of
integer-lists. But what exactly do these equations mean? Consider the following
34 Chapter 2 Values and types
set of values:
{nil}
U {cons(i, nil) | i e Integer}
U {cons(i, constf, nil)) \ i,j e Integer}
U [constf, constf, cons(k, nil))) \ i,j, k e Integer}
U...
L = Unit + {T x L) (2.22)
has a least solution for L that corresponds to the set of all finite lists of values
chosen from T. Every other solution is a superset of the least solution.
Lists (or sequences) are so ubiquitous that they deserve a notation of their
own: T* stands for the set of all finite lists of values chosen from T. Thus:
The following (unidiomatic) Java class declarations together define lists of integers:
class IntList {
public IntNode first;
DARLING LOUISA,-I can assure you that I am no more likely than yourself
to form another attachment, as you will perceive by what follows. Before we
left town I thought that to be able to see you occasionally was sufficient
for happiness, but down in this lonely place the case is different. In
short, my dear, I ask you to consent to a union with me as soon as you
possibly can. Your prettiness has won my eyes and lips completely, sweet,
and I lie awake at night to think of the golden curls you allowed to escape
from their confinement on those nice times of private clothes, when we
walked in the park and slipped the bonds of service, which you were never
born to any more than I. . . .
'Had not my own feelings been so strong, I should have told you at the
first dash of my pen that what I expected is coming to pass at last-the old
dog is going to be privately married to Mrs. P. Yes, indeed, and the
wedding is coming off to-morrow, secret as the grave. All her friends will
doubtless leave service on account of it. What he does now makes little
difference to me, of course, as I had already given warning, but I shall
stick to him like a Briton in spite of it. He has to-day made me a present,
and a further five pounds for yourself, expecting you to hold your tongue on
every matter connected with Mrs. P.'s friends, and to say nothing to any of
them about this marriage until it is over. His lordship impressed this upon
me very strong, and familiar as a brother, and of course we obey his
instructions to the letter; for I need hardly say that unless he keeps his
promise to help me in setting up the shop, our nuptials cannot be consumed.
His help depends upon our obedience, as you are aware. . . .'
This, and much more, was from her very last lover, Lord
Mountclere's valet, who had been taken in hand directly she had
convinced herself of Joey's hopeless youthfulness. The missive sent
Mrs. Menlove's spirits soaring like spring larks; she flew upstairs in
answer to the bell with a joyful, triumphant look, which the
illuminated figure of Mrs. Doncastle in her dressing-room could not
quite repress. One could almost forgive Menlove her arts when so
modest a result brought such vast content.
Mrs. Doncastle seemed inclined to make no remark during the
dressing, and at last Menlove could repress herself no longer.
'I should like to name something to you, m'm.'
'Yes.'
'I shall be wishing to leave soon, if it is convenient.'
'Very well, Menlove,' answered Mrs. Doncastle, as she serenely
surveyed her right eyebrow in the glass. 'Am I to take this as a
formal notice?'
'If you please; but I could stay a week or two beyond the month if
suitable. I am going to be married-that's what it is, m'm.'
'O! I am glad to hear it, though I am sorry to lose you.'
'It is Lord Mountclere's valet-Mr. Tipman-m'm.'
'Indeed.'
Menlove went on building up Mrs. Doncastle's hair awhile in
silence.
'I suppose you heard the other news that arrived in town to-day,
m'm?' she said again. 'Lord Mountclere is going to be married to-
morrow.'
'To-morrow? Are you quite sure?'
'O yes, m'm. Mr. Tipman has just told me so in his letter. He is
going to be married to Mrs. Petherwin. It is to be quite a private
wedding.'
Mrs. Doncastle made no remark, and she remained in the same
still position as before; but a countenance expressing transcendent
surprise was reflected to Menlove by the glass.
At this sight Menlove's tongue so burned to go further, and unfold
the lady's relations with the butler downstairs, that she would have
lost a month's wages to be at liberty to do it. The disclosure was
almost too magnificent to be repressed. To deny herself so exquisite
an indulgence required an effort which nothing on earth could have
sustained save the one thing that did sustain it-the knowledge that
upon her silence hung the most enormous desideratum in the world,
her own marriage. She said no more, and Mrs. Doncastle went away.
It was an ordinary family dinner that day, but their nephew Neigh
happened to be present. Just as they were sitting down Mrs.
Doncastle said to her husband: 'Why have you not told me of the
wedding to-morrow?-or don't you know anything about it?'
'Wedding?' said Mr. Doncastle.
'Lord Mountclere is to be married to Mrs. Petherwin quite
privately.'
'Good God!' said some person.
Mr. Doncastle did not speak the words; they were not spoken by
Neigh: they seemed to float over the room and round the walls, as if
originating in some spiritualistic source. Yet Mrs. Doncastle,
remembering the symptoms of attachment between Ethelberta and
her nephew which had appeared during the summer, looked towards
Neigh instantly, as if she thought the words must have come from
him after all; but Neigh's face was perfectly calm; he, together with
her husband, was sitting with his eyes fixed in the direction of the
sideboard; and turning to the same spot she beheld Chickerel
standing pale as death, his lips being parted as if he did not know
where he was.
'Did you speak?' said Mrs. Doncastle, looking with astonishment at
the butler.
'Chickerel, what's the matter-are you ill?' said Mr. Doncastle
simultaneously. 'Was it you who said that?'
'I did, sir,' said Chickerel in a husky voice, scarcely above a
whisper. 'I could not help it.'
'Why?'
'She is my daughter, and it shall be known at once!'
'Who is your daughter?'
He paused a few moments nervously. 'Mrs. Petherwin,' he said.
Upon this announcement Neigh looked at poor Chickerel as if he
saw through him into the wall. Mrs. Doncastle uttered a faint
exclamation and leant back in her chair: the bare possibility of the
truth of Chickerel's claims to such paternity shook her to pieces
when she viewed her intimacies with Ethelberta during the past
season-the court she had paid her, the arrangements she had
entered into to please her; above all, the dinner-party which she had
contrived and carried out solely to gratify Lord Mountclere and bring
him into personal communication with the general favourite; thus
making herself probably the chief though unconscious instrument in
promoting a match by which her butler was to become father-in-law
to a peer she delighted to honour. The crowd of perceptions almost
took away her life; she closed her eyes in a white shiver.
'Do you mean to say that the lady who sat here at dinner at the
same time that Lord Mountclere was present, is your daughter?'
asked Doncastle.
'Yes, sir,' said Chickerel respectfully.
'How did she come to be your daughter?'
'I- Well, she is my daughter, sir.'
'Did you educate her?'
'Not altogether, sir. She was a very clever child. Lady Petherwin
took a deal of trouble about her education. They were both left
widows about the same time: the son died, then the father. My
daughter was only seventeen then. But though she's older now, her
marriage with Lord Mountclere means misery. He ought to marry
another woman.'
'It is very extraordinary,' Mr. Doncastle murmured. 'If you are ill
you had better go and rest yourself, Chickerel. Send in Thomas.'
Chickerel, who seemed to be much disturbed, then very gladly left
the room, and dinner proceeded. But such was the peculiarity of the
case, that, though there was in it neither murder, robbery, illness,
accident, fire, or any other of the tragic and legitimate shakers of
human nerves, two of the three who were gathered there sat
through the meal without the least consciousness of what viands
had composed it. Impressiveness depends as much upon propinquity
as upon magnitude; and to have honoured unawares the daughter
of the vilest Antipodean miscreant and murderer would have been
less discomfiting to Mrs. Doncastle than it was to make the same
blunder with the daughter of a respectable servant who happened to
live in her own house. To Neigh the announcement was as the
catastrophe of a story already begun, rather than as an isolated
wonder. Ethelberta's words had prepared him for something, though
the nature of that thing was unknown.
'Chickerel ought not to have kept us in ignorance of this-of course
he ought not!' said Mrs. Doncastle, as soon as they were left alone.
'I don't see why not,' replied Mr. Doncastle, who took the matter
very coolly, as was his custom.
'Then she herself should have let it be known.'
'Nor does that follow. You didn't tell Mrs. Petherwin that your
grandfather narrowly escaped hanging for shooting his rival in a
duel.'
'Of course not. There was no reason why I should give extraneous
information.'
'Nor was there any reason why she should. As for Chickerel, he
doubtless felt how unbecoming it would be to make personal
remarks upon one of your guests-Ha-ha-ha! Well, well-Ha-ha-ha-ha!'
'I know this,' said Mrs. Doncastle, in great anger, 'that if my father
had been in the room, I should not have let the fact pass unnoticed,
and treated him like a stranger!'
'Would you have had her introduce Chickerel to us all round? My
dear Margaret, it was a complicated position for a woman.'
'Then she ought not to have come!'
'There may be something in that, though she was dining out at
other houses as good as ours. Well, I should have done just as she
did, for the joke of the thing. Ha-ha-ha!-it is very good-very. It was a
case in which the appetite for a jest would overpower the sting of
conscience in any well-constituted being-that, my dear, I must
maintain.'
'I say she should not have come!' answered Mrs. Doncastle firmly.
'Of course I shall dismiss Chickerel.'
'Of course you will do no such thing. I have never had a butler in
the house before who suited me so well. It is a great credit to the
man to have such a daughter, and I am not sure that we do not
derive some lustre of a humble kind from his presence in the house.
But, seriously, I wonder at your short-sightedness, when you know
the troubles we have had through getting new men from nobody
knows where.'
Neigh, perceiving that the breeze in the atmosphere might
ultimately intensify to a palpable black squall, seemed to think it
would be well to take leave of his uncle and aunt as soon as he
conveniently could; nevertheless, he was much less discomposed by
the situation than by the active cause which had led to it. When Mrs.
Doncastle arose, her husband said he was going to speak to
Chickerel for a minute or two, and Neigh followed his aunt upstairs.
Presently Doncastle joined them. 'I have been talking to Chickerel,'
he said. 'It is a very curious affair-this marriage of his daughter and
Lord Mountclere. The whole situation is the most astounding I have
ever met with. The man is quite ill about the news. He has shown
me a letter which has just reached him from his son on the same
subject. Lord Mountclere's brother and this young man have actually
gone off together to try to prevent the wedding, and Chickerel has
asked to be allowed to go himself, if he can get soon enough to the
station to catch the night mail. Of course he may go if he wishes.'
'What a funny thing!' said the lady, with a wretchedly factitious
smile. 'The times have taken a strange turn when the angry parent
of the comedy, who goes post-haste to prevent the undutiful
daughter's rash marriage, is a gentleman from below stairs, and the
unworthy lover a peer of the realm!'
Neigh spoke for almost the first time. 'I don't blame Chickerel in
objecting to Lord Mountclere. I should object to him myself if I had a
daughter. I never liked him.'
'Why?' said Mrs. Doncastle, lifting her eyelids as if the act were a
heavy task.
'For reasons which don't generally appear.'
'Yes,' said Mr. Doncastle, in a low tone. 'Still, we must not believe
all we hear.'
'Is Chickerel going?' said Neigh.
'He leaves in five or ten minutes,' said Doncastle.
After a few further words Neigh mentioned that he was unable to
stay longer that evening, and left them. When he had reached the
outside of the door he walked a little way up the pavement and back
again, as if reluctant to lose sight of the street, finally standing
under a lamp-post whence he could command a view of Mr.
Doncastle's front. Presently a man came out in a great-coat and with
a small bag in his hand; Neigh at once recognizing the person as
Chickerel, went up to him.
'Mr. Doncastle tells me you are going on a sudden journey. At
what time does your train leave?' Neigh asked.
'I go by the ten o'clock, sir: I hope it is a third-class,' said
Chickerel; 'though I am afraid it may not be.'
'It is as much as you will do to get to the station,' said Neigh,
turning the face of his watch to the light. 'Here, come into my cab-I
am driving that way.'
'Thank you, sir,' said Chickerel.
Neigh called a cab at the first opportunity, and they entered and
drove along together. Neither spoke during the journey. When they
were driving up to the station entrance Neigh looked again to see
the hour.
'You have not a minute to lose,' he said, in repressed anxiety. 'And
your journey will be expensive: instead of walking from Anglebury to
Knollsea, you had better drive-above all, don't lose time. Never mind
what class the train is. Take this from me, since the emergency is
great.' He handed something to Chickerel folded up small.
The butler took it without inquiry, and stepped out hastily.
'I sincerely hope she- Well, good-night, Chickerel,' continued
Neigh, ending his words abruptly. The cab containing him drove
again towards the station-gates, leaving Chickerel standing on the
kerb.
He passed through the booking-office, and looked at the paper
Neigh had put into his hand. It was a five-pound note.
Chickerel mused on the circumstance as he took his ticket and got
into the train.
43. THE RAILWAY-THE SEA-THE
SHORE BEYOND
By this time Sol and the Honourable Edgar Mountclere had gone
far on their journey into Wessex. Enckworth Court, Mountclere's
destination, though several miles from Knollsea, was most easily
accessible by the same route as that to the village, the latter being
the place for which Sol was bound.
From the few words that passed between them on the way,
Mountclere became more stubborn than ever in a belief that this was
a carefully laid trap of the fair Ethelberta's to ensnare his brother
without revealing to him her family ties, which it therefore behoved
him to make clear, with the utmost force of representation, before
the fatal union had been contracted. Being himself the viscount's
only remaining brother and near relative, the disinterestedness of his
motives may be left to imagination; that there was much real excuse
for his conduct must, however, be borne in mind. Whether his
attempt would prevent the union was another question: he believed
that, conjoined with his personal influence over the viscount, and
the importation of Sol as a firebrand to throw between the betrothed
pair, it might do so.
About half-an-hour before sunset the two individuals, HANDlinked
by their differences, reached the point of railway at which the branch
to Sandbourne left the main line. They had taken tickets for
Sandbourne, intending to go thence to Knollsea by the steamer that
plied between the two places during the summer months-making
this a short and direct route. But it occurred to Mountclere on the
way that, summer being over, the steamer might possibly have left
off running, the wind might be too high for a small boat, and no
large one might be at hand for hire: therefore it would be safer to go
by train to Anglebury, and the remaining sixteen miles by driving
over the hills, even at a great loss of time.
Accident, however, determined otherwise. They were in the station
at the junction, inquiring of an official if the Speedwell had ceased to
sail, when a countryman who had just come up from Sandbourne
stated that, though the Speedwell had left off for the year, there was
that day another steamer at Sandbourne. This steamer would of
necessity return to Knollsea that evening, partly because several
people from that place had been on board, and also because the
Knollsea folk were waiting for groceries and draperies from London:
there was not an ounce of tea or a hundredweight of coal in the
village, owing to the recent winds, which had detained the provision
parcels at Sandbourne, and kept the colliers up-channel until the
change of weather this day. To introduce necessaries by a
roundabout land journey was not easy when they had been ordered
by the other and habitual route. The boat returned at six o'clock.
So on they went to Sandbourne, driving off to the pier directly
they reached that place, for it was getting towards night. The
steamer was there, as the man had told them, much to the relief of
Sol, who, being extremely anxious to enter Knollsea before a late
hour, had known that this was the only way in which it could be
done.
Some unforeseen incident delayed the boat, and they walked up
and down the pier to wait. The prospect was gloomy enough. The
wind was north-east; the sea along shore was a chalky-green,
though comparatively calm, this part of the coast forming a shelter
from wind in its present quarter. The clouds had different velocities,
and some of them shone with a coppery glare, produced by rays
from the west which did not enter the inferior atmosphere at all. It
was reflected on the distant waves in patches, with an effect as if
the waters were at those particular spots stained with blood. This
departed, and what daylight was left to the earth came from strange
and unusual quarters of the heavens. The zenith would be bright, as
if that were the place of the sun; then all overhead would close, and
a whiteness in the east would give the appearance of morning; while
a bank as thick as a wall barricaded the west, which looked as if it
had no acquaintance with sunsets, and would blush red no more.
'Any other passengers?' shouted the master of the steamboat. 'We
must be off: it may be a dirty night.'
Sol and Mountclere went on board, and the pier receded in the
dusk.
'Shall we have any difficulty in getting into Knollsea Bay?' said
Mountclere.
'Not if the wind keeps where it is for another hour or two.'
'I fancy it is shifting to the east'ard,' said Sol.
The captain looked as if he had thought the same thing.
'I hope I shall be able to get home to-night,' said a Knollsea
woman. 'My little children be left alone. Your mis'ess is in a bad way,
too-isn't she, skipper?'
'Yes.'
'And you've got the doctor from Sandbourne aboard, to tend her?'
'Yes.'
'Then you'll be sure to put into Knollsea, if you can?'
'Yes. Don't be alarmed, ma'am. We'll do what we can. But no one
must boast.'
The skipper's remark was the result of an observation that the
wind had at last flown to the east, the single point of the compass
whence it could affect Knollsea Bay. The result of this change was
soon perceptible. About midway in their transit the land elbowed out
to a bold chalk promontory; beyond this stretched a vertical wall of
the same cliff, in a line parallel with their course. In fair weather it
was possible and customary to steer close along under this hoary
facade for the distance of a mile, there being six fathoms of water
within a few boats' lengths of the precipice. But it was an ugly spot
at the best of times, landward no less than seaward, the cliff
rounding off at the top in vegetation, like a forehead with low-grown
hair, no defined edge being provided as a warning to unwary
pedestrians on the downs above.
As the wind sprung up stronger, white clots could be discerned at
the water level of the cliff, rising and falling against the black band
of shaggy weed that formed a sort of skirting to the base of the wall.
They were the first-fruits of the new east blast, which shaved the
face of the cliff like a razor-gatherings of foam in the shape of
heads, shoulders, and arms of snowy whiteness, apparently
struggling to rise from the deeps, and ever sinking back to their old
levels again. They reminded an observer of a drowning scene in a
picture of the Deluge. At some points the face of rock was hollowed
into gaping caverns, and the water began to thunder into these with
a leap that was only topped by the rebound seaward again. The
vessel's head was kept a little further to sea, but beyond that
everything went on as usual.
The precipice was still in view, and before it several huge columns
of rock appeared, detached from the mass behind. Two of these
were particularly noticeable in the grey air-one vertical, stout and
square; the other slender and tapering. They were individualized as
husband and wife by the coast men. The waves leapt up their sides
like a pack of hounds; this, however, though fearful in its
boisterousness, was nothing to the terrible games that sometimes
went on round the knees of those giants in stone. Yet it was
sufficient to cause the course of the frail steamboat to be altered yet
a little more-from south-west-by-south to south-by-west-to give the
breakers a still wider berth.
'I wish we had gone by land, sir; 'twould have been surer play,'
said Sol to Mountclere, a cat-and-dog friendship having arisen
between them.
'Yes,' said Mountclere. 'Knollsea is an abominable place to get into
with an east wind blowing, they say.'
Another circumstance conspired to make their landing more
difficult, which Mountclere knew nothing of. With the wind easterly,
the highest sea prevailed in Knollsea Bay from the slackening of
flood-tide to the first hour of ebb. At that time the water outside
stood without a current, and ridges and hollows chased each other
towards the beach unchecked. When the tide was setting strong up
or down Channel its flow across the mouth of the bay thrust aside,
to some extent, the landward plunge of the waves.
We glance for a moment at the state of affairs on the land they
were nearing.
This was the time of year to know the truth about the inner nature
and character of Knollsea; for to see Knollsea smiling to the summer
sun was to see a courtier before a king; Knollsea was not to be
known by such simple means. The half-dozen detached villas used
as lodging-houses in the summer, standing aloof from the cots of the
permanent race, rose in the dusk of this gusty evening, empty,
silent, damp, and dark as tombs. The gravel walks leading to them
were invaded by leaves and tufts of grass. As the darkness thickened
the wind increased, and each blast raked the iron railings before the
houses till they hummed as if in a song of derision. Certainly it
seemed absurd at this time of year that human beings should expect
comfort in a spot capable of such moods as these.
However, one of the houses looked cheerful, and that was the
dwelling to which Ethelberta had gone. Its gay external colours
might as well have been black for anything that could be seen of
them now, but an unblinded window revealed inside it a room bright
and warm. It was illuminated by firelight only. Within, Ethelberta
appeared against the curtains, close to the glass. She was watching
through a binocular a faint light which had become visible in the
direction of the bluff far away over the bay.
'Here is the Spruce at last, I think,' she said to her sister, who was
by the fire. 'I hope they will be able to land the things I have
ordered. They are on board I know.'
The wind continued to rise till at length something from the lungs
of the gale alighted like a feather upon the pane, and remained
there sticking. Seeing the substance, Ethelberta opened the window
to secure it. The fire roared and the pictures kicked the walls; she
closed the sash, and brought to the light a crisp fragment of foam.
'How suddenly the sea must have risen,' said Picotee.
The servant entered the room. 'Please, mis'ess says she is afraid
you won't have your things to-night, 'm. They say the steamer can't
land, and mis'ess wants to know if she can do anything?'
'It is of no consequence,' said Ethelberta. 'They will come some
time, unless they go to the bottom.'
The girl left the room. 'Shall we go down to the shore and see
what the night is like?' said Ethelberta. 'This is the last opportunity I
shall have.'
'Is it right for us to go, considering you are to be married to-
morrow?' said Picotee, who had small affection for nature in this
mood.
Her sister laughed. 'Let us put on our cloaks-nobody will know us.
I am sorry to leave this grim and primitive place, even for Enckworth
Court.'
They wrapped themselves up, and descended the hill.
On drawing near the battling line of breakers which marked the
meeting of sea and land they could perceive within the nearly
invisible horizon an equilateral triangle of lights. It was formed of
three stars, a red on the one side, a green on the other, and a white
on the summit. This, composed of mast-head and side lamps, was
all that was visible of the Spruce, which now faced end-on about
half-a-mile distant, and was still nearing the pier. The girls went
further, and stood on the foreshore, listening to the din. Seaward
appeared nothing distinct save a black horizontal band embodying
itself out of the grey water, strengthening its blackness, and
enlarging till it looked like a nearing wall. It was the concave face of
a coming wave. On its summit a white edging arose with the aspect
of a lace frill; it broadened, and fell over the front with a terrible
concussion. Then all before them was a sheet of whiteness, which
spread with amazing rapidity, till they found themselves standing in
the midst of it, as in a field of snow. Both felt an insidious chill
encircling their ankles, and they rapidly ran up the beach.
'You girls, come away there, or you'll be washed off: what need
have ye for going so near?'
Ethelberta recognized the stentorian voice as that of Captain
Flower, who, with a party of boatmen, was discovered to be standing
near, under the shelter of a wall. He did not know them in the
gloom, and they took care that he should not. They retreated further
up the beach, when the hissing fleece of froth slid again down the
shingle, dragging the pebbles under it with a rattle as of a beast
gnawing bones.
The spot whereon the men stood was called 'Down-under-wall;' it
was a nook commanding a full view of the bay, and hither the
nautical portion of the village unconsciously gravitated on windy
afternoons and nights, to discuss past disasters in the reticent spirit
induced by a sense that they might at any moment be repeated. The
stranger who should walk the shore on roaring and sobbing
November eves when there was not light sufficient to guide his
footsteps, and muse on the absoluteness of the solitude, would be
surprised by a smart 'Good-night' being returned from this corner in
company with the echo of his tread. In summer the six or eight
perennial figures stood on the breezy side of the wall-in winter and
in rain to leeward; but no weather was known to dislodge them.
'I had no sooner come ashore than the wind began to fly round,'
said the previous speaker; 'and it must have been about the time
they were off Old-Harry Point. "She'll put back for certain," I said;
and I had no more thought o' seeing her than John's set-net that
was carried round the point o' Monday.'
'Poor feller: his wife being in such a state makes him anxious to
land if 'a can: that's what 'tis, plain enough.'
'Why that?' said Flower.
'The doctor's aboard, 'a believe: "I'll have the most understanding
man in Sandbourne, cost me little or much," he said.'
''Tis all over and she's better,' said the other. 'I called half-an-hour
afore dark.'
Flower, being an experienced man, knew how the judgment of a
ship's master was liable to be warped by family anxieties, many
instances of the same having occurred in the history of navigation.
He felt uneasy, for he knew the deceit and guile of this bay far better
than did the master of the Spruce, who, till within a few recent
months, had been a stranger to the place. Indeed, it was the bay
which had made Flower what he was, instead of a man in thriving
retirement. The two great ventures of his life had been blown ashore
and broken up within that very semicircle. The sturdy sailor now
stood with his eyes fixed on the triangle of lights which showed that
the steamer had not relinquished her intention of bringing up inside
the pier if possible; his right hand was in his pocket, where it played
with a large key which lay there. It was the key of the lifeboat shed,
and Flower was coxswain. His musing was on the possibility of a use
for it this night.
It appeared that the captain of the Spruce was aiming to pass in
under the lee of the pier; but a strong current of four or five knots
was running between the piles, drifting the steamer away at every
attempt as soon as she slowed. To come in on the other side was
dangerous, the hull of the vessel being likely to crash against and
overthrow the fragile erection, with damage to herself also. Flower,
who had disappeared for a few minutes, now came back.
'It is just possible I can make 'em hear with the trumpet, now they
be to leeward,' he said, and proceeded with two or three others to
grope his way out upon the pier, which consisted simply of a row of
rotten piles covered with rotten planking, no balustrade of any kind
existing to keep the unwary from tumbling off. At the water level the
piles were eaten away by the action of the sea to about the size of a
man's wrist, and at every fresh influx the whole structure trembled
like a spider's web. In this lay the danger of making fast, for a
strong pull from a headfast rope might drag the erection completely
over. Flower arrived at the end, where a lantern hung.
'Spruce ahoy!' he blared through the speaking trumpet two or
three times.
There seemed to be a reply of some sort from the steamer.
'Tuesday's gale hev loosened the pier, Cap'n Ounce; the bollards
be too weak to make fast to: must land in boats if ye will land, but
dangerous; yer wife is out of danger, and 'tis a boy-y-y-y!'
Ethelberta and Picotee were at this time standing on the beach a
hundred and fifty yards off. Whether or not the master of the
steamer received the information volunteered by Flower, the two
girls saw the triangle of lamps get narrow at its base, reduce
themselves to two in a vertical line, then to one, then to darkness.
The Spruce had turned her head from Knollsea.
'They have gone back, and I shall not have my wedding things
after all!' said Ethelberta. 'Well, I must do without them.'
'You see, 'twas best to play sure,' said Flower to his comrades, in a
tone of complacency. 'They might have been able to do it, but 'twas
risky. The shop-folk be out of stock, I hear, and the visiting lady up
the hill is terribly in want of clothes, so 'tis said. But what's that?
Ounce ought to have put back afore.'
Then the lantern which hung at the end of the jetty was taken
down, and the darkness enfolded all around from view. The bay
became nothing but a voice, the foam an occasional touch upon the
face, the Spruce an imagination, the pier a memory. Everything
lessened upon the senses but one; that was the wind. It mauled
their persons like a hand, and caused every scrap of their raiment to
tug westward. To stand with the face to sea brought semi-
suffocation, from the intense pressure of air.
The boatmen retired to their position under the wall, to lounge
again in silence. Conversation was not considered necessary: their
sense of each other's presence formed a kind of conversation.
Meanwhile Picotee and Ethelberta went up the hill.
'If your wedding were going to be a public one, what a misfortune
this delay of the packages would be,' said Picotee.
'Yes,' replied the elder.
'I think the bracelet the prettiest of all the presents he brought to-
day-do you?'
'It is the most valuable.'
'Lord Mountclere is very kind, is he not? I like him a great deal
better than I did-do you, Berta?'
'Yes, very much better,' said Ethelberta, warming a little. 'If he
were not so suspicious at odd moments I should like him
exceedingly. But I must cure him of that by a regular course of
treatment, and then he'll be very nice.'
'For an old man. He likes you better than any young man would
take the trouble to do. I wish somebody else were old too.'
'He will be some day.'
'Yes, but-'
'Never mind: time will straighten many crooked things.'
'Do you think Lord Mountclere has reached home by this time?'
'I should think so: though I believe he had to call at the parsonage
before leaving Knollsea.'
'Had he? What for?'
'Why, of course somebody must-'
'O yes. Do you think anybody in Knollsea knows it is going to be
except us and the parson?'
'I suppose the clerk knows.'
'I wonder if a lord has ever been married so privately before.'
'Frequently: when he marries far beneath him, as in this case. But
even if I could have had it, I should not have liked a showy wedding.
I have had no experience as a bride except in the private form of the
ceremony.'
'Berta, I am sometimes uneasy about you even now and I want to
ask you one thing, if I may. Are you doing this for my sake? Would
you have married Mr. Julian if it had not been for me?'
'It is difficult to say exactly. It is possible that if I had had no
relations at all, I might have married him. And I might not.'
'I don't intend to marry.'
'In that case you will live with me at Enckworth. However, we will
leave such details till the ground-work is confirmed. When we get
indoors will you see if the boxes have been properly corded, and are
quite ready to be sent for? Then come in and sit by the fire, and I'll
sing some songs to you.'
'Sad ones, you mean.'
'No, they shall not be sad.'
'Perhaps they may be the last you will ever sing to me.'
'They may be. Such a thing has occurred.'
'But we will not think so. We'll suppose you are to sing many to
me yet.'
'Yes. There's good sense in that, Picotee. In a world where the
blind only are cheerful we should all do well to put out our eyes.
There, I did not mean to get into this state: forgive me, Picotee. It is
because I have had a thought-why I cannot tell-that as much as this
man brings to me in rank and gifts he may take out of me in tears.'
'Berta!'
'But there's no reason in it-not any; for not in a single matter does
what has been supply us with any certain ground for knowing what
will be in the world. I have seen marriages where happiness might
have been said to be ensured, and they have been all sadness
afterwards; and I have seen those in which the prospect was black
as night, and they have led on to a time of sweetness and comfort.
And I have seen marriages neither joyful nor sorry, that have
become either as accident forced them to become, the persons
having no voice in it at all. Well, then, why should I be afraid to
make a plunge when chance is as trustworthy as calculation?'
'If you don't like him well enough, don't have him, Berta. There's
time enough to put it off even now.'
'O no. I would not upset a well-considered course on the haste of
an impulse. Our will should withstand our misgivings. Now let us see
if all has been packed, and then we'll sing.'
That evening, while the wind was wheeling round and round the
dwelling, and the calm eye of the lighthouse afar was the single
speck perceptible of the outside world from the door of Ethelberta's
temporary home, the music of songs mingled with the stroke of the
wind across the iron railings, and was swept on in the general tide of
the gale, and the noise of the rolling sea, till not the echo of a tone
remained.
An hour before this singing, an old gentleman might have been
seen to alight from a little one-horse brougham, and enter the door
of Knollsea parsonage. He was bent upon obtaining an entrance to
the vicar's study without giving his name.
But it happened that the vicar's wife was sitting in the front room,
making a pillow-case for the children's bed out of an old surplice
which had been excommunicated the previous Easter; she heard the
newcomer's voice through the partition, started, and went quickly to
her husband, who was where he ought to have been, in his study. At
her entry he looked up with an abstracted gaze, having been lost in
meditation over a little schooner which he was attempting to rig for
their youngest boy. At a word from his wife on the suspected name
of the visitor, he resumed his earlier occupation of inserting a few
strong sentences, full of the observation of maturer life, between the
lines of a sermon written during his first years of ordination, in order
to make it available for the coming Sunday. His wife then vanished
with the little ship in her hand, and the visitor appeared. A talk went
on in low tones.
After a ten minutes' stay he departed as secretly as he had come.
His errand was the cause of much whispered discussion between the
vicar and his wife during the evening, but nothing was said
concerning it to the outside world.
44. SANDBOURNE-A LONELY
HEATH-THE 'RED LION'-THE
HIGHWAY
It was half-past eleven before the Spruce, with Mountclere and Sol
Chickerel on board, had steamed back again to Sandbourne. The
direction and increase of the wind had made it necessary to keep
the vessel still further to sea on their return than in going, that they
might clear without risk the windy, sousing, thwacking, basting,
scourging Jack Ketch of a corner called Old-Harry Point, which lay
about halfway along their track, and stood, with its detached posts
and stumps of white rock, like a skeleton's lower jaw, grinning at
British navigation. Here strong currents and cross currents were
beginning to interweave their scrolls and meshes, the water rising
behind them in tumultuous heaps, and slamming against the fronts
and angles of cliff, whence it flew into the air like clouds of flour.
Who could now believe that this roaring abode of chaos smiled in
the sun as gently as an infant during the summer days not long
gone by, every pinnacle, crag, and cave returning a doubled image
across the glassy sea?
They were now again at Sandbourne, a point in their journey
reached more than four hours ago. It became necessary to consider
anew how to accomplish the difficult remainder. The wind was not
blowing much beyond what seamen call half a gale, but there had
been enough unpleasantness afloat to make landsmen glad to get
ashore, and this dissipated in a slight measure their vexation at
having failed in their purpose. Still, Mountclere loudly cursed their
confidence in that treacherously short route, and Sol abused the
unknown Sandbourne man who had brought the news of the
steamer's arrival to them at the junction. The only course left open
to them now, short of giving up the undertaking, was to go by the
road along the shore, which, curving round the various little creeks
and inland seas between their present position and Knollsea, was of
no less length than thirty miles. There was no train back to the
junction till the next morning, and Sol's proposition that they should
drive thither in hope of meeting the mail-train, was overruled by
Mountclere.
'We will have nothing more to do with chance,' he said. 'We may
miss the train, and then we shall have gone out of the way for
nothing. More than that, the down mail does not stop till it gets
several miles beyond the nearest station for Knollsea; so it is
hopeless.'
'If there had only been a telegraph to the confounded place!'
'Telegraph-we might as well telegraph to the devil as to an old
booby and a damned scheming young widow. I very much question
if we shall do anything in the matter, even if we get there. But I
suppose we had better go on now?'
'You can do as you like. I shall go on, if I have to walk every step
o't.'
'That's not necessary. I think the best posting-house at this end of
the town is Tempett's-we must knock them up at once. Which will
you do-attempt supper here, or break the back of our journey first,
and get on to Anglebury? We may rest an hour or two there, unless
you feel really in want of a meal.'
'No. I'll leave eating to merrier men, who have no sister in the
hands of a cursed old Vandal.'
'Very well,' said Mountclere. 'We'll go on at once.'
An additional half-hour elapsed before they were fairly started, the
lateness and abruptness of their arrival causing delay in getting a
conveyance ready: the tempestuous night had apparently driven the
whole town, gentle and simple, early to their beds. And when at
length the travellers were on their way the aspect of the weather
grew yet more forbidding. The rain came down unmercifully, the
booming wind caught it, bore it across the plain, whizzed it against
the carriage like a sower sowing his seed. It was precisely such
weather, and almost at the same season, as when Picotee traversed
the same moor, stricken with her great disappointment at not
meeting Christopher Julian.
Further on for several miles the drive lay through an open heath,
dotted occasionally with fir plantations, the trees of which told the
tale of their species without help from outline or colour; they spoke
in those melancholy moans and sobs which give to their sound a
solemn sadness surpassing even that of the sea. From each
carriage-lamp the long rays stretched like feelers into the air, and
somewhat cheered the way, until the insidious damp that pervaded
all things above, around, and underneath, overpowered one of
them, and rendered every attempt to rekindle it ineffectual. Even
had the two men's dislike to each other's society been less, the
general din of the night would have prevented much talking; as it
was, they sat in a rigid reticence that was almost a third personality.
The roads were laid hereabouts with a light sandy gravel, which,
though not clogging, was soft and friable. It speedily became
saturated, and the wheels ground heavily and deeply into its
substance.
At length, after crossing from ten to twelve miles of these eternal
heaths under the eternally drumming storm, they could discern
eyelets of light winking to them in the distance from under a
nebulous brow of pale haze. They were looking on the little town of
Havenpool. Soon after this cross-roads were reached, one of which,
at right angles to their present direction, led down on the left to that
place. Here the man stopped, and informed them that the horses
would be able to go but a mile or two further.
'Very well, we must have others that can,' said Mountclere. 'Does
our way lie through the town?'
'No, sir-unless we go there to change horses, which I thought to
do. The direct road is straight on. Havenpool lies about three miles
down there on the left. But the water is over the road, and we had
better go round. We shall come to no place for two or three miles,
and then only to Flychett.'
'What's Flychett like?'
'A trumpery small bit of a village.'
'Still, I think we had better push on,' said Sol. 'I am against
running the risk of finding the way flooded about Havenpool.'
'So am I,' returned Mountclere.
'I know a wheelwright in Flychett,' continued Sol, 'and he keeps a
beer-house, and owns two horses. We could hire them, and have a
bit of sommat in the shape of victuals, and then get on to Anglebury.
Perhaps the rain may hold up by that time. Anything's better than
going out of our way.'
'Yes. And the horses can last out to that place,' said Mountclere.
'Up and on again, my man.'
On they went towards Flychett. Still the everlasting heath, the
black hills bulging against the sky, the barrows upon their round
summits like warts on a swarthy skin. The storm blew huskily over
bushes of heather and furze that it was unable materially to disturb,
and the travellers proceeded as before. But the horses were now far
from fresh, and the time spent in reaching the next village was quite
half as long as that taken up by the previous heavy portion of the
drive. When they entered Flychett it was about three.
'Now, where's the inn?' said Mountclere, yawning.
'Just on the knap,' Sol answered. ''Tis a little small place, and we
must do as well as we can.'
They pulled up before a cottage, upon the whitewashed front of
which could be seen a square board representing the sign. After an
infinite labour of rapping and shouting, a casement opened
overhead, and a woman's voice inquired what was the matter. Sol
explained, when she told them that the horses were away from
home.
'Now we must wait till these are rested,' growled Mountclere. 'A
pretty muddle!'
'It cannot be helped,' answered Sol; and he asked the woman to
open the door. She replied that her husband was away with the
horses and van, and that they could not come in.
Sol was known to her, and he mentioned his name; but the
woman only began to abuse him.
'Come, publican, you'd better let us in, or we'll have the law for't,'
rejoined Sol, with more spirit. 'You don't dare to keep nobility waiting
like this.'
'Nobility!'
'My mate hev the title of Honourable, whether or no; so let's have
none of your slack,' said Sol.
'Don't be a fool, young chopstick,' exclaimed Mountclere. 'Get the
door opened.'
'I will-in my own way,' said Sol testily. 'You mustn't mind my
trading upon your quality, as 'tis a case of necessity. This is a woman
nothing will bring to reason but an appeal to the higher powers. If
every man of title was as useful as you are to-night, sir, I'd never call
them lumber again as long as I live.'
'How singular!'
'There's never a bit of rubbish that won't come in use if you keep
it seven years.'
'If my utility depends upon keeping you company, may I go to h
—- for lacking every atom of the virtue.'
'Hear, hear! But it hardly is becoming in me to answer up to a man
so much older than I, or I could say more. Suppose we draw a line
here for the present, sir, and get indoors?'
'Do what you will, in Heaven's name.'
A few more words to the woman resulted in her agreeing to admit
them if they would attend to themselves afterwards. This Sol
promised, and the key of the door was let down to them from the
bedroom window by a string. When they had entered, Sol, who
knew the house well, busied himself in lighting a fire, the driver
going off with a lantern to the stable, where he found standing-room
for the two horses. Mountclere walked up and down the kitchen,
mumbling words of disgust at the situation, the few of this kind that
he let out being just enough to show what a fearfully large number
he kept in.
'A-calling up people at this time of morning!' the woman
occasionally exclaimed down the stairs. 'But folks show no mercy
upon their flesh and blood-not one bit or mite.'
'Now never be stomachy, my good soul,' cried Sol from the
fireplace, where he stood blowing the fire with his breath. 'Only tell
me where the victuals bide, and I'll do all the cooking. We'll pay like
princes-especially my mate.'
'There's but little in house,' said the sleepy woman from her
bedroom. 'There's pig's fry, a side of bacon, a conger eel, and
pickled onions.'
'Conger eel?' said Sol to Mountclere.
'No, thank you.'
'Pig's fry?'
'No, thank you.'
'Well, then, tell me where the bacon is,' shouted Sol to the
woman.
'You must find it,' came again down the stairs. ''Tis somewhere up
in chimley, but in which part I can't mind. Really I don't know
whether I be upon my head or my heels, and my brain is all in a
spin, wi' being rafted up in such a larry!'
'Bide where you be, there's a dear,' said Sol. 'We'll do it all. Just
tell us where the tea-caddy is, and the gridiron, and then you can go
to sleep again.'
The woman appeared to take his advice, for she gave the
information, and silence soon reigned upstairs.
When one piece of bacon had been with difficulty cooked over the
newly-lit fire, Sol said to Mountclere, with the rasher on his fork:
'Now look here, sir, I think while I am making the tea, you ought to
go on griddling some more of these, as you haven't done nothing at
all?'
'I do the paying. . . . Well, give me the bacon.'
'And when you have done yours, I'll cook the man's, as the poor
feller's hungry, I make no doubt.'
Mountclere, fork in hand, then began with his rasher, tossing it
about the gridiron in masterly style, Sol attending to the tea. He was
attracted from this occupation by a brilliant flame up the chimney,
Mountclere exclaiming, 'Now the cursed thing is on fire!'
'Blow it out-hard-that's it! Well now, sir, do you come and begin
upon mine, as you must be hungry. I'll finish the griddling. Ought we
to mind the man sitting down in our company, as there's no other
room for him? I hear him coming in.'
'O no-not at all. Put him over at that table.'
'And I'll join him. You can sit here by yourself, sir.'
The meal was despatched, and the coachman again retired,
promising to have the horses ready in about an hour and a half. Sol
and Mountclere made themselves comfortable upon either side of
the fireplace, since there was no remedy for the delay: after sitting
in silence awhile, they nodded and slept.
How long they would have remained thus, in consequence of their
fatigues, there is no telling, had not the mistress of the cottage
descended the stairs about two hours later, after peeping down upon
them at intervals of five minutes during their sleep, lest they should
leave without her knowledge. It was six o'clock, and Sol went out for
the man, whom he found snoring in the hay-loft. There was now real
necessity for haste, and in ten minutes they were again on their way.
Day dawned upon the 'Red Lion' inn at Anglebury with a timid and
watery eye. From the shadowy archway came a shining lantern,
which was seen to be dangling from the hand of a little bow-legged
old man-the hostler, John. Having reached the front, he looked
around to measure the daylight, opened the lantern, and
extinguished it by a pinch of his fingers. He paused for a moment to
have the customary word or two with his neighbour the milkman,
who usually appeared at this point at this time.
'It sounds like the whistle of the morning train,' the milkman said
as he drew near, a scream from the further end of the town reaching
their ears. 'Well, I hope, now the wind's in that quarter, we shall ha'e
a little more fine weather-hey, hostler?'
'What be ye a talking o'?'
'Can hear the whistle plain, I say.'
'O ay. I suppose you do. But faith, 'tis a poor fist I can make at
hearing anything. There, I could have told all the same that the wind
was in the east, even if I had not seed poor Thomas Tribble's smoke
blowing across the little orchard. Joints be a true weathercock
enough when past three-score. These easterly rains, when they do
come, which is not often, come wi' might enough to squail a man
into his grave.'
'Well, we must look for it, hostler. . . . Why, what mighty ekkypage
is this, come to town at such a purbHANDlinking time of day?'
''Tis what time only can tell-though 'twill not be long first,' the
hostler replied, as the driver of the pair of horses and carriage
containing Sol and Mountclere slackened pace, and drew rein before
the inn.
Fresh horses were immediately called for, and while they were
being put in the two travellers walked up and down.
'It is now a quarter to seven o'clock,' said Mountclere; 'and the
question arises, shall I go on to Knollsea, or branch off at Corvsgate
Castle for Enckworth? I think the best plan will be to drive first to
Enckworth, set me down, and then get him to take you on at once
to Knollsea. What do you say?'
'When shall I reach Knollsea by that arrangement?'
'By half-past eight o'clock. We shall be at Enckworth before eight,
which is excellent time.'
'Very well, sir, I agree to that,' said Sol, feeling that as soon as one
of the two birds had been caught, the other could not mate without
their knowledge.
The carriage and horses being again ready, away they drove at
once, both having by this time grown too restless to spend in
Anglebury a minute more than was necessary.
The hostler and his lad had taken the jaded Sandbourne horses to
the stable, rubbed them down, and fed them, when another noise
was heard outside the yard; the omnibus had returned from meeting
the train. Relinquishing the horses to the small stable-lad, the old
hostler again looked out from the arch.
A young man had stepped from the omnibus, and he came
forward. 'I want a conveyance of some sort to take me to Knollsea,
at once. Can you get a horse harnessed in five minutes?'
'I'll make shift to do what I can master, not promising about the
minutes. The truest man can say no more. Won't ye step into the
bar, sir, and give your order? I'll let ye know as soon as 'tis ready.'
Christopher turned into a room smelling strongly of the night
before, and stood by the newly-kindled fire to wait. He had just
come in haste from Melchester. The upshot of his excitement about
the wedding, which, as the possible hour of its solemnization drew
near, had increased till it bore him on like a wind, was this
unpremeditated journey. Lying awake the previous night, the
hangings of his bed pulsing to every beat of his heart, he decided
that there was one last and great service which it behoved him, as
an honest man and friend, to say nothing of lover, to render to
Ethelberta at this juncture. It was to ask her by some means
whether or not she had engaged with open eyes to marry Lord
Mountclere; and if not, to give her a word or two of enlightenment.
That done, she might be left to take care of herself.
His plan was to obtain an interview with Picotee, and learn from
her accurately the state of things. Should he, by any possibility, be
mistaken in his belief as to the contracting parties, a knowledge of
the mistake would be cheaply purchased by the journey. Should he
not, he would send up to Ethelberta the strong note of expostulation
which was already written, and waiting in his pocket. To intrude
upon her at such a time was unseemly; and to despatch a letter by a
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
ebookbell.com