Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
100% found this document useful (1 vote)
16 views

Programming Algorithms in Lisp 1st Edition Vsevolod Domkin 2024 scribd download

The document promotes the ebook 'Programming Algorithms in Lisp' by Vsevolod Domkin, which focuses on writing efficient programs using ANSI Common Lisp. It provides links to download the ebook and additional recommended digital products. The content includes various chapters on algorithms, data structures, and programming techniques relevant to Lisp.

Uploaded by

spirgimayron
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
16 views

Programming Algorithms in Lisp 1st Edition Vsevolod Domkin 2024 scribd download

The document promotes the ebook 'Programming Algorithms in Lisp' by Vsevolod Domkin, which focuses on writing efficient programs using ANSI Common Lisp. It provides links to download the ebook and additional recommended digital products. The content includes various chapters on algorithms, data structures, and programming techniques relevant to Lisp.

Uploaded by

spirgimayron
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

Get the full ebook with Bonus Features for a Better Reading Experience on ebookmeta.

com

Programming Algorithms in Lisp 1st Edition


Vsevolod Domkin

https://ebookmeta.com/product/programming-algorithms-in-
lisp-1st-edition-vsevolod-domkin/

OR CLICK HERE

DOWLOAD NOW

Download more ebook instantly today at https://ebookmeta.com


Recommended digital products (PDF, EPUB, MOBI) that
you can download immediately if you are interested.

Programming Algorithms in Lisp: Writing Efficient Programs


with Examples in ANSI Common Lisp 1st Edition Vsevolod
Domkin
https://ebookmeta.com/product/programming-algorithms-in-lisp-writing-
efficient-programs-with-examples-in-ansi-common-lisp-1st-edition-
vsevolod-domkin/
ebookmeta.com

Land of Lisp Learn to Program in Lisp One Game at a Time


1st Edition Conrad Barski

https://ebookmeta.com/product/land-of-lisp-learn-to-program-in-lisp-
one-game-at-a-time-1st-edition-conrad-barski/

ebookmeta.com

Concurrent Programming Algorithms Principles and


Foundations 1st Edition Michel Raynal

https://ebookmeta.com/product/concurrent-programming-algorithms-
principles-and-foundations-1st-edition-michel-raynal/

ebookmeta.com

Their Tribute Cherished Galaxy 2 1st Edition Cady Austin

https://ebookmeta.com/product/their-tribute-cherished-galaxy-2-1st-
edition-cady-austin/

ebookmeta.com
Howling for Attention Half Moon Key 1 1st Edition Milly
Taiden

https://ebookmeta.com/product/howling-for-attention-half-moon-
key-1-1st-edition-milly-taiden/

ebookmeta.com

Defense Economics An Institutional Perspective Marcus


Matthias Keupp

https://ebookmeta.com/product/defense-economics-an-institutional-
perspective-marcus-matthias-keupp/

ebookmeta.com

Indian Economy 7th Edition Vivek Singh

https://ebookmeta.com/product/indian-economy-7th-edition-vivek-singh/

ebookmeta.com

Architecture Principles The Cornerstones of Enterprise


Architecture The Enterprise Engineering Series Danny
Greefhorst
https://ebookmeta.com/product/architecture-principles-the-
cornerstones-of-enterprise-architecture-the-enterprise-engineering-
series-danny-greefhorst/
ebookmeta.com

Edinburgh Critical Studies in Law, Literature, and the


Humanities: Sensing Justice through Contemporary Spanish
Cinema - Aesthetics, Politics, Law 1st Edition Mónica
López Lerma
https://ebookmeta.com/product/edinburgh-critical-studies-in-law-
literature-and-the-humanities-sensing-justice-through-contemporary-
spanish-cinema-aesthetics-politics-law-1st-edition-monica-lopez-lerma/
ebookmeta.com
The Films of Lenny Abrahamson A Filmmaking of Philosophy
1st Edition Barry Monahan

https://ebookmeta.com/product/the-films-of-lenny-abrahamson-a-
filmmaking-of-philosophy-1st-edition-barry-monahan/

ebookmeta.com
Vsevolod Domkin
Programming Algorithms in Lisp
Writing Efficient Programs with Examples in ANSI
Common Lisp
1st ed.
Vsevolod Domkin
Kyiv, Ukraine

Any source code or other supplementary material referenced by the


author in this book is available to readers on GitHub via the book’s
product page, located at www.​apress.​com/​9781484264270. For more
detailed information, please visit http://​www.​apress.​com/​source-code.

ISBN 978-1-4842-6427-0 e-ISBN 978-1-4842-6428-7


https://doi.org/10.1007/978-1-4842-6428-7

© Vsevolod Domkin 2021

This work is subject to copyright. All rights are reserved by the


Publisher, whether the whole or part of the material is concerned,
specifically the rights of translation, reprinting, reuse of illustrations,
recitation, broadcasting, reproduction on microfilms or in any other
physical way, and transmission or information storage and retrieval,
electronic adaptation, computer software, or by similar or dissimilar
methodology now known or hereafter developed.

The use of general descriptive names, registered names, trademarks,


service marks, etc. in this publication does not imply, even in the
absence of a specific statement, that such names are exempt from the
relevant protective laws and regulations and therefore free for general
use.

The publisher, the authors and the editors are safe to assume that the
advice and information in this book are believed to be true and accurate
at the date of publication. Neither the publisher nor the authors or the
editors give a warranty, expressed or implied, with respect to the
material contained herein or for any errors or omissions that may have
been made. The publisher remains neutral with regard to jurisdictional
claims in published maps and institutional affiliations.

Distributed to the book trade worldwide by Apress Media, LLC, 1 New


York Plaza, New York, NY 10004, U.S.A. Phone 1-800-SPRINGER, fax
(201) 348-4505, e-mail orders-ny@springer-sbm.com, or visit
www.springeronline.com. Apress Media, LLC is a California LLC and the
sole member (owner) is Springer Science + Business Media Finance Inc
(SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation.
Acknowledgments
I’m very thankful to those who helped me in the work on Programming
Algorithms in Lisp by providing support, advice, corrections, and
suggestions. First of all, many thanks to my wife, Ksenya, who
encouraged me to work on it despite the time that was, in part, taken
from my family duties. Michał “phoe” Herda contributed a very
thorough and detail-oriented review that helped correct a couple of
significant misunderstandings on my part and pushed me to add more
code and explanations where they were lacking. He has also
championed the idea of a separate repository with all the book’s code
accompanied by a test suite and helped me in this undertaking.
I am very grateful to Dr. Robert Strandh who humbly volunteered
his help as an editor of the initial chapters of the book to make it sound
more native (as my English is far from perfect since I’m not a native
speaker) and point out the mistakes that I made. He and his wife,
Kathleen, have contributed lots of improvements to more than half of
the chapters, and I tried to follow their advice in the subsequent ones.
Thanks to Rainer Joswig for commenting on the Lisp choices. I’m also
grateful to my father, Dr. Volodymyr Demkine, for reviewing and
proofing the book. Thanks to @dzenicv on reddit who posted links to
almost all of the chapters there, which triggered some helpful
discussions. Thanks to @tom_mellior on Hacker News for pointing a
serious deficiency in the explanation of Union-Find. Thanks to all those
people who shared the links to the chapters and contributed their
comments and attention.
Table of Contents
Chapter 1:​Introduction
Why Algorithms Matter
A Few Words About Lisp
Chapter 2:​Algorithmic Complexity
Chapter 3:​A Crash Course in Lisp
The Core of Lisp
A Code Example
The REPL
Basic Expressions
Sequential Execution
Branching
Looping
Procedures and Variables
Comments
Getting Started
Chapter 4:​Data Structures
Data Structures vs.​Algorithms
The Data Structure Concept
Contiguous and Linked Data Structures
Tuples
Passing Data Structures in Function Calls
Structs in Action:​Union-Find
Takeaways
Chapter 5:​Arrays
Arrays as Sequences
Dynamic Vectors
Why Are Arrays Indexed from 0
Multidimensional​Arrays
Binary Search
Binary Search in Action:​A Fast Specialized In-Memory DB
Sorting
O(n^2) Sorting
Quicksort
Production Sort
Performance Benchmark
Takeaways
Chapter 6:​Linked Lists
Lists as Sequences
Lists as Functional Data Structures
Different Kinds of Lists
FIFO and LIFO
Queue
Stack
Deque
Stacks in Action:​SAX Parsing
Lists as Sets
Merge Sort
Parallelization of Merge Sort
Lists and Lisp
Takeaways
Chapter 7:​Key-Values
Concrete Key-values
Simple Arrays
Associative Lists
Hash-Tables
Structs
Trees
Operations
Memoization
Memoization in Action:​Transposition Tables
Cache Invalidation
Second Chance and Clock Algorithms
LFU
LRU
Low-Level Caching
Takeaways
Chapter 8:​Hash-Tables
Implementation
Dealing with Collisions
Hash-Code
Advanced Hashing Techniques
Hash-Functions
Operations
Initialization
Access
Iteration
Perfect Hashing
Implementation
The CHM92 Algorithm
Distributed Hash-Tables
Hashing in Action:​Content Addressing
Takeaways
Chapter 9:​Trees
Implementation Variants
Tree Traversal
Binary Search Trees
Splay Trees
Complexity Analysis
Red-Black and AVL Trees
B-Trees
Heaps
Tries
Trees in Action:​Efficient Mapping
Takeaways
Chapter 10:​Graphs
Graph Representations
Topological Sort
MST
Prim’s Algorithm
Kruskal’s Algorithm
Pathfinding
Dijkstra’s Algorithm
A* Algorithm
Maximum Flow
Graphs in Action:​PageRank
Implementation
Takeaways
Chapter 11:​Strings
Basic String-Related Optimizations
Strings in the Editor
Substring Search
Knuth-Morris-Pratt (KMP)
Boyer-Moore (BM)
Rabin-Karp (RK)
Aho-Corasick (AC)
Regular Expressions
Implementation of Thompson’s Construction
Grammars
String Search in Action:​Plagiarism Detection
Takeaways
Chapter 12:​Dynamic Programming
Fibonacci Numbers
String Segmentation
Text Justification
Pathfinding Revisited
LCS and Diff
DP in Action:​Backprop
Takeaways
Chapter 13:​Approximation
Combinatorial Optimization
Local Search
Evolutionary Algorithms
Branch and Bound
Gradient Descent
Improving GD
Sampling
Matrix Factorization
Singular Value Decomposition
Fourier Transform
Fourier Transform in Action:​JPEG
Takeaways
Chapter 14:​Compression
Encoding
Base64
Lossless Compression
Huffman Coding
Huffman Coding in Action:​Dictionary Optimization
Arithmetic Coding
DEFLATE
Takeaways
Chapter 15:​Synchronization
Synchronization Troubles
Low-Level Synchronization
Mutual Exclusion Algorithms
High-Level Synchronization
Lock-Free Data Structures
Data Parallelism and Message Passing
STM
Distributed Computations
Distributed Algorithms
Distributed Data Structures
Distributed Algorithms in Action:​Collaborative Editing
Persistent Data Structures
Takeaways
Afterword
Index
About the Author
Vsevolod Domkin
from Kyiv, Ukraine, is a Lisp programmer and enthusiast, a natural
language processing researcher, an occasional writer/blogger, and a
teacher.
About the Technical Reviewer
Michał “phoe” Herda
is a programmer with contributions to
multiple parts of the Common Lisp (CL)
ecosystem: CL implementations, existing
and widely used CL utilities,
documentation, and some of the new
library ideas that he slowly pushes
forward and works on.
Random documents with unrelated
content Scribd suggests to you:
of accommodation which has at no time been intermitted, and to the
result which now calls for our congratulations as corroborating the
principles by which the public councils have been guided during a
period of the most trying embarrassments.”
When Madison spoke of the “principles by which the public
councils have been guided,” he meant to place at their head the
principles of embargo and non-intercourse,—a result of Erskine’s
arrangement hardly more agreeable to commercial America than to
despotic England; but however England might resent what Canning
would certainly think an offence, Americans were in no humor for
fault-finding, and they received Madison’s allusions with little protest.
The remainder of the Message contained nothing that called for
dispute.
The Federalist minority—strong in numbers, flushed by victory
over Jefferson, and full of contempt for the abilities of their
opponents—found themselves suddenly deprived by Erskine and
Madison of every grievance to stand upon. For once, no one
charged that Madison’s act was dictated from the Tuileries. The
Federalist newspapers, like their Republican rivals, advanced the
idea that their success was the natural result of their own
statesmanship. Their efforts against the embargo had opened the
path for Canning’s good-will to show itself, and the removal of
Jefferson’s sinister influence accounted for the brilliancy of
Madison’s success. The attempt to approve Erskine’s arrangement
without approving Jefferson’s system, required ingenuity as great as
was shown in the similar attempt of Madison to weigh down
Erskine’s arrangement by coupling it with the embargo. These party
tactics would hardly deserve notice had not John Randolph, in
drawing a sharp line between Jefferson and Madison, enlivened the
monotony of debate by comments not without interest.
“Without the slightest disposition to create unpleasant sensations,”
said he, “to go back upon the footsteps of the last four years, I do
unequivocally say that I believe the country will never see such
another Administration as the last. It had my hearty approbation for
one half of its career; as for my opinion of the remainder of it, it has
been no secret. The lean kine of Pharaoh devoured the fat kine; the
last four years, with the embargo in their train, ate up the rich harvest
of the first four; and if we had not had some Joseph to have stepped
in and changed the state of things, what would have been now the
condition of the country? I repeat it,—never has there been any
Administration which went out of office and left the country in a state
so deplorable and calamitous as the last.”
Not satisfied with criticising Jefferson, Randolph committed
himself to the opinion that Canning had been influenced by the same
antipathy, and had been withheld from earlier concessions only by
Jefferson’s conduct:—
“Mr. Canning obtained as good a bargain from us as he could have
expected to obtain; and those gentlemen who speak of his having
heretofore had it in his power to have done the same, did not take into
calculation the material difference between the situation in which we
now stand and the situation in which we before stood.”
In the virulence of temper with which Randolph blackened the
Administration of Jefferson, he could not help committing himself to
unqualified support of Madison; and even Barent Gardenier, whose
temper was at least as indiscreet as Randolph’s, seemed to revel in
the pleasure of depressing the departed President in order to elevate
the actual Executive, whose eight years of coming power were more
dangerous to the opposition than the eight years of Jefferson had
ever been.
“I am pretty well satisfied,” said Barent Gardenier,[64] “that when
the secret history of the two last years is divulged, it will be found that
while the former President was endeavoring to fan the flames of war,
the Secretary of State ... was smoothing the way for the happy
discharge of his Presidential duties when he should come to the chair.
I think it did him honor.... It is for the promptitude and frankness with
which the President met the late overture that I thank him most
cordially for my country. I approve it most heartily.... And it is now in
proof before us, as I have said and contended, that nothing was
wanting but a proper spirit of conciliation, and fair and honorable
dealing on the part of this country, to bring to a happy issue all the
fictitious differences between this country and Great Britain.”
Political indiscretion could go no further. The rule that in public life
one could never safely speak well of an opponent, was illustrated by
the mistake of the Federalists in praising Madison merely to gratify
their antipathy to Jefferson. Had they been silent; or had they shown
suspicion, they would have been safe; but all admitted that French
influence and hostility to England had vanished with Jefferson; all
were positive that England had gained what she had sought, and
that Canning had every reason to be satisfied. For the moment
Madison was the most popular President that ever had met
Congress. At no session since 1789 had such harmony prevailed as
during the five weeks of this political paradise, although not one
element had changed its character or position, and the harmony, like
the discord, was a play of imagination. Congress passed its bills with
unanimity altogether new. That which restored relations of commerce
with England passed without discussion, except on the point whether
French ships of war should be admitted to American ports.
Somewhat to the alarm of the Eastern men, Congress decided not to
exclude French national vessels,—a decision which threw some
doubt on Madison’s wish to push matters to a head with Napoleon.
Yet care was taken to avoid offence to Great Britain. Little was said
and nothing was done about impressments. An attempt to increase
the protective duties was defeated. Not a voice was raised on behalf
of France; not a fear of Napoleon’s revenge found tongue.
Although no one ventured to avow suspicion that Canning would
refuse to ratify Erskine’s act, news continued to arrive from England
which seemed hard to reconcile with any immediate thought, in the
British ministry, of giving up their restrictive system. June 10, the day
when amid universal delight the new arrangement went into effect,
the public pleasure was not a little disturbed by the arrival of news
that on April 26 the British government had issued a very important
Order in Council, revoking the order of Nov. 11, 1807, and
establishing in its place a general blockade of Holland, France, and
Italy. This step, though evidently a considerable concession,—which
would have produced its intended effect in checking hostile feeling if
Erskine had not intervened,—roused anxiety because of its remote
resemblance to Erskine’s arrangement, which it seemed to adopt by
means that the United States could not admit as legal or consistent
with the terms of Erskine’s letters.
“The new Orders,” wrote Madison to Jefferson,[65] ... “present a
curious feature in the conduct of the British Cabinet. It is explained by
some at the expense of its sincerity. It is more probably ascribed, I
think, to an awkwardness in getting out of an awkward situation, and
to the policy of withholding as long as possible from France the motive
of its example to have advances on her part toward adjustment with
us. The crooked proceeding seems to be operating as a check to the
extravagance of credit given to Great Britain for the late arrangement
with us, and so far may be salutary.”
Such reasoning was soon felt to be insufficient. The more the
new order was studied, the less its motive was understood. How
could Canning in January have authorized Erskine to withdraw the
orders of 1807 without reserve, when in April, without waiting to hear
from Erskine, he himself withdrew those orders only to impose
another that had every mark of permanence? How could Erskine,
April 18, have been authorized to throw open the ports of Holland,
when his Government, April 26, was engaged in imposing a new
blockade upon them? So rapidly did the uneasiness of Congress
increase that Erskine was obliged to interpose. June 15 he wrote an
official note to the Secretary of State, which the President sent the
same day to Congress.[66]
“I have the honor,” said Erskine, “to enclose a copy of an Order of
his Majesty in Council issued on the 26th of April last. In consequence
of official communications sent to me from his Majesty’s government
since the adoption of that measure, I am enabled to assure you that it
has no connection whatever with the overtures which I have been
authorized to make to the government of the United States; and that I
am persuaded that the terms of the agreement so happily concluded
by the recent negotiation will be strictly fulfilled on the part of his
Majesty.”
The expressions of this letter, if carefully read, still left cause for
doubt; and Madison saw it, although he clung to what he thought he
had gained. June 20 he wrote again to Jefferson:[67]—
“The ‘Gazette’ of yesterday contains the mode pursued for
reanimating confidence in the pledge of the British government given
by Mr. Erskine in his arrangement with this government. The puzzle
created by the Order of April struck every one. Erskine assures us that
his Government was under such impressions as to the views of this,
that not the slightest expectation existed of our fairly meeting its
overtures, and that the last order was considered as a seasonable
mitigation of the tendency of a failure of the experiment. This
explanation seems as extraordinary as the alternative it shows. The
fresh declarations of Mr. Erskine seem to have quieted the distrust
which was becoming very strong, but has not destroyed the effect of
the ill grace stamped on the British retreat, and of the commercial
rigor evinced by the new and insidious duties stated in the
newspapers. It may be expected, I think, that the British government
will fulfil what its minister has stipulated; and that if it means to be
trickish, it will frustrate the proposed negotiation, and then say their
orders were not permanently repealed but only withdrawn in the mean
time.”
Madison had chosen to precipitate a decision, with a view to
profiting in either case, whether England consented or refused to
have her hands thus forced. Indeed, if he had not himself been old in
the ways of diplomacy, Turreau was on the spot to warn him, and
lost no chance of lecturing the Administration on the folly of trusting
Erskine’s word.
Meanwhile Turreau so far lost his temper as to address to
Secretary Smith a long letter complaining of the persistently
unfriendly attitude of the United States government toward France.
So strong was the language of the letter that Turreau was obliged to
withdraw it.[68] Robert Smith attempted to pacify him by assurances
that the new Administration would respect the Spanish possessions
more strictly than the old one had done.
“The Secretary of State did not deny that there might have been
some attempt in that direction,” reported Turreau, June 14,[69] “but at
the same time, while himself alluding to the affair of Miranda, he
attributed these events to causes independent of the actual
Administration and anterior to its existence, and especially to the
weakness and the indiscretions of Mr. Jefferson; that he [Smith] was
then in the Cabinet, and knew better than any one how much the want
of vigor (mollesse), the uncertainty, and absence of plan in the
Executive head had contributed to the false steps of the Federal
government.”
The new Administration meant to show vigor. Every act and
expression implied that its path was to be direct to its ends. The
President and Congress waited with composure for the outcome of
Erskine’s strange conduct.
No new measure was suggested, after June 10, to provide for the
chance that Erskine’s arrangement might fail, and that the Order in
Council of April 26, 1809, might prove to be a permanent system.
Congress seemed disposed to indulge the merchants to the utmost
in their eagerness for trade. The nearest approach to suspicion was
shown in the House by appropriating $750,000 for fortifications.
Randolph, Macon, Eppes, and Richard M. Johnson tried to reduce
the amount to $150,000. The larger appropriation was understood to
mean an intention of preparing for attack, and eighty-four members
sustained the policy against a minority of forty-seven; but
notwithstanding this vote and the anxiety caused by the new Order in
Council, Congress decided to stop enlistments for the army; and by
an Act approved June 28 the President was authorized, “in the event
of a favorable change in our foreign relations,” to reduce the naval
force, although the words of the Act implied doubt whether the
favorable change would take place.
Nothing could be happier for Madison than this situation, where
all parties were held in check not only by his success but by his
danger. So completely was discipline restored, that June 27 he
ventured to send the name of J. Q. Adams a second time to the
Senate as minister to Russia; and nineteen Republicans confirmed
the nomination, while but one adhered to the opinion that the mission
was unnecessary. The power of England over America was never
more strikingly shown than by the sudden calm which fell on the
country, in full prospect of war with France, at a word from a British
minister. As Canning frowned or smiled, faction rose to frenzy or lay
down to slumber throughout the United States. No sooner did the
news of Erskine’s arrangement reach Quebec May 1, than Sir James
Craig recalled his secret agent, John Henry, from Boston, where he
still lingered. “I am cruelly out of spirits,” wrote Secretary Ryland to
Henry,[70] “at the idea of Old England truckling to such a debased
and accursed government as that of the United States;” but since
this was the case, Henry’s services could no longer be useful. He
returned to Montreal early in June.
June 28 Congress adjourned, leaving the Executive, for the first
time in many years, almost without care, until the fourth Monday in
November.
CHAPTER V.
Erskine’s despatches were received by Canning May 22, and
the “Morning Post” of the next day printed the news with approval:
“Upon this pleasing event we sincerely congratulate the public.” The
“Times” of May 24 accepted the arrangement: “We shall not urge
anything against the concessions.” May 25, with “considerable pain
though but little surprise,” the same newspaper announced that
Erskine was disavowed by the Government.
Canning’s abrupt rejection of Erskine’s arrangement without
explanation must have seemed even to himself a high-handed
course, at variance with some of his late professions, certain to
injure or even to destroy British influence in America, and likely to
end in war. To the settlement as a practical measure no objection
could be alleged. No charge of bad faith could be supported. No
shadow of law or reason could be devised for enforcing against
America rights derived from retaliation upon France, when America
enforced stronger measures of retaliation upon France than those
imposed by the Orders in Council. Neither the Non-importation Act of
1806, nor the “Chesapeake” proclamation of 1807, nor the embargo,
nor the Non-intercourse Act of March, 1809, could be used to justify
the rejection of an arrangement which evaded or removed every
British grievance. Even the subject of impressments had been
suppressed by the American government. Madison flung himself into
Canning’s arms, and to fling him back was an effort of sheer
violence.
Perhaps the effort gave to Canning’s conduct an air that he would
not naturally have cared to betray; for his manner was that of a man
irritated by finding himself obliged to be brutal. In the want of a
reason for rejecting the American arrangement, he was reduced to
rejecting it without giving a reason. The process of disciplining
Erskine was simple, for Erskine had disregarded instructions to an
extent that no government could afford to overlook; but President
Madison was not in the employ of the British king, and had a right to
such consideration at least as one gentleman commonly owes to
another.
Canning addressed himself first to the simpler task. May 22, a
few hours after receiving the despatches from Washington, he wrote
a despatch to Erskine in regard to the “Chesapeake” arrangement.
[71] He reminded Erskine that his instructions had required the formal
exclusion of French war-vessels and the formal withdrawal of the
“Chesapeake” proclamation before any arrangement should be
concluded. Not only had these conditions been neglected, but two
other less serious errors had been made.
Variations from the rigor of instructions might be ground for
reproving Erskine, but could hardly excuse a disavowal of the
compact; yet the compact was disavowed. An impression was
general that the Ministry were disposed to ratify it, but were withheld
by the paragraph in Robert Smith’s letter defining what was due from
his Britannic Majesty to his own honor. Milder Foreign Secretaries
than George Canning would have found themselves obliged to take
notice of such a reflection, and Canning appeared at his best when
his adversaries gave him an excuse for the lofty tone he liked to
assume.
“It remains for me,” he continued, “to notice the expressions, so full
of disrespect to his Majesty, with which that note concludes; and I am
to signify to you the displeasure which his Majesty feels that any
minister of his Majesty should have shown himself so far insensible of
what is due to the dignity of his sovereign as to have consented to
receive and transmit a note in which such expressions were
contained.”
Canning was hardly the proper person to criticise Robert Smith’s
disrespectful expressions, which, whatever their intention, failed to
be nearly as offensive as many of his own; but this was a matter
between himself and Erskine. Even after granting the propriety of his
comment, diplomatic usage seemed to require that some demand of
explanation or apology from the American government should
precede the rejection of an engagement otherwise satisfactory; but
no such step was in this case taken through Erskine. His settlement
of the “Chesapeake” outrage was repudiated without more words,
and the next day Canning repudiated the rest of the arrangement.
Nothing could be easier than to show that Erskine had violated
his instructions more plainly in regard to the Orders in Council than
in regard to the “Chesapeake” affair. Of the three conditions imposed
by Canning, not one had been fulfilled. The first required the repeal
of all Non-intercourse Acts against England, “leaving them in force
with respect to France;” but Erskine had doubly failed to secure it:[72]

“As the matter at present stands before the world in your official
correspondence with Mr. Smith, the American government would be at
liberty to-morrow to repeal the Non-intercourse Act altogether, without
infringing the agreement which you have thought proper to enter into
on behalf of his Majesty; and if such a clause was thought necessary
to this condition at the time when my instructions were written, it was
obviously become much more so when the Non-intercourse Act was
passed for a limited time. You must also have been aware at the time
of making the agreement that the American government had in fact
formally exempted Holland, a Power which has unquestionably
‘adopted and acted under the Decrees of France,’ from the operation
of the Non-intercourse Act,—an exemption in direct contravention of
the condition prescribed to you, and which of itself ought to have
prevented you from coming to any agreement whatever.”
Here, again, sufficient reasons were given for punishing Erskine;
but these reasons were not equally good for repudiating the compact
with the United States. No American vessels could enter a Dutch
port so long as the British blockade lasted; therefore the exemption
of Holland from the non-intercourse affected England only by giving
to her navy another chance for booty, and to the Americans one
more empty claim. Canning himself explained to Pinkney[73] “that the
exemption of Holland from the effect of our embargo and non-
intercourse would not have been much objected to by the British
government” if the President had been willing to pledge himself to
enforce the non-intercourse against France; but for aught that
appeared to the contrary, “the embargo and non-intercourse laws
might be suffered without any breach of faith to expire, or might even
be repealed immediately, notwithstanding the perseverance of
France in her Berlin and other edicts; and that Mr. Erskine had in
truth secured nothing more, as the consideration of the recall of the
Orders in Council, than the renewal of American intercourse with
Great Britain.”
Thus Canning justified the repudiation of Erskine’s arrangement
by the single reason that the United States government could not be
trusted long enough to prove its good faith. The explanation was
difficult to express in courteous or diplomatic forms; but perhaps its
most striking quality, next to its want of courtesy, was its evident want
of candor. Had the American government evaded its obligation, the
British government held the power of redress in its own hands.
Clearly the true explanation was to be sought elsewhere, in some
object which Canning could not put in diplomatic words, but which
lay in the nature of Perceval’s system. Even during the three days
while the decision was supposed to be in doubt, alarmed merchants
threw themselves in crowds on the Board of Trade, protesting that if
American vessels with their cheaper sugar, cotton, and coffee were
allowed to enter Amsterdam and Antwerp, British trade was at an
end.[74] The mere expectation of their arrival would create such a fall
in prices as to make worthless the accumulated mass of such
merchandise with which the warehouses were filled, not only in
London, but also in the little island of Heligoland at the mouth of the
Elbe, where a system of licensed and unlicensed smuggling had
been established under the patronage of the Board of Trade.
Deputations of these merchants waited on Earl Bathurst to represent
the danger of allowing even those American ships to enter Holland
which might have already sailed from the United States on the faith
of Erskine’s arrangement. Somewhat unexpectedly ministers refused
to gratify this prayer. An Order in Council of May 24, while
announcing the Royal repudiation of Erskine’s arrangement,
declared that American vessels which should have cleared for
Holland between April 19 and July 20 would not be molested in their
voyage.
The chief objection to Erskine’s arrangement, apart from its effect
on British merchants, consisted in the danger that by its means
America might compel France to withdraw her decrees affecting
neutrals. The chance that Erskine’s arrangement might involve
America in war with Napoleon was not worth the equal chance of its
producing in the end an amicable arrangement with Napoleon which
would sacrifice the last defence of British commerce and
manufactures. Had the British government given way, Napoleon, to
whom the most solemn pledges cost nothing, would certainly
persuade President Madison to lean once more toward France. The
habit of balancing the belligerents—the first rule of American
diplomacy—required the incessant see-saw of interest. So many
unsettled questions remained open that British ministers could not
flatter themselves with winning permanent American favor by partial
concession.
To Canning’s despatch repudiating the commercial arrangement,
Erskine made a reply showing more keenness and skill than was to
be found in Canning’s criticism.
“It appears from the general tenor of your despatches,” wrote
Erskine[75] on receiving these letters of May 22 and 23, “that his
Majesty’s government were not willing to trust to assurances from the
American government, but that official pledges were to have been
required which could not be given for want of power, some of them
also being of a nature which would prevent a formal recognition. Had I
believed that his Majesty’s government were determined to insist upon
these conditions being complied with in one particular manner only, I
should have adhered implicitly to my instructions; but as I collected
from them that his Majesty was desirous of accomplishing his
retaliatory system by such means as were most compatible with a
good understanding with friendly and neutral Powers, I felt confident
that his Majesty would approve of the arrangement I had concluded as
one likely to lead to a cordial and complete understanding and co-
operation on the part of the United States, which co-operation never
could be obtained by previous stipulations either from the government
of the United States, who have no power to accede to them, or from
Congress, which would never acknowledge them as recognitions to
guide their conduct.”

This reply, respectful in form, placed Secretary Canning in the


dilemma between the guilt of ignorance or that of bad faith; but the
rejoinder of a dismissed diplomatist weighed little except in history,
and long before it was made public Erskine and his arrangement had
ceased to interest the world. Canning disposed of both forever by a
third despatch, dated May 30, enclosing to Erskine an Order in
Council disavowing his arrangement and ordering him back to
England.
When the official disavowal appeared in the newspapers of May
25, Canning had an interview with Pinkney.[76] At great length and
with much detail he read the instructions he had given to Erskine,
and commented on the points in which Erskine had violated them.
He complained of unfriendly expressions in the American notes; but
he did not say why the arrangement failed to satisfy all the legitimate
objects of England, nor did he suggest any improvement or change
which would make the arrangement, as it existed, agreeable to him.
On the other hand, he announced that though Erskine would have to
be recalled, his successor was already appointed and would sail for
America within a few days.
If Canning showed, by his indulgence to American vessels and
his haste to send out a new minister, the wish to avoid a rupture with
the United States, his selection of an agent for that purpose was so
singular as to suggest that he relied on terror rather than on
conciliation. In case Erskine had obeyed his instructions, which
ordered him merely to prepare the way for negotiation, Canning had
fixed upon George Henry Rose as the negotiator.[77] Considering the
impression left in America by Rose on his previous mission, his
appointment seemed almost the worst that could have been made;
but bad as the effect of such a selection would have been, one man,
and perhaps only one, in England was certain to make a worse; and
him Canning chose. The new minister was Francis James Jackson.
Whatever good qualities Jackson possessed were overshadowed by
the reputation he had made for himself at Copenhagen. His name
was a threat of violence; his temper and manners were notorious;
and nothing but his rank in the service marked him as suitable for the
post. Pinkney, whose self-control and tact in these difficult
circumstances could hardly be too much admired, listened in silence
to Canning’s announcement, and rather than risk making the
situation worse, reported that Jackson was, he believed, “a worthy
man, and although completely attached to all those British principles
and doctrines which sometimes give us trouble will, I should hope,
give satisfaction.” The English press was not so forbearing. The
“Morning Chronicle” of May 29 said that the appointment had excited
general surprise, owing to “the character of the individual;” and
Pinkney himself, in a later despatch, warned his Government that “it
is rather a prevailing notion here that this gentleman’s conduct will
not and cannot be what we all wish, and that a better choice might
have been made.”[78]
Jackson himself sought the position, knowing its difficulties. May
23, the day of his appointment, he wrote privately to his brother in
Spain: “I am about to enter upon a most delicate—I hope not
desperate—enterprise.”[79] At a later time, embittered by want of
support from home, he complained that Canning had sent him on an
errand which he knew to be impossible to perform.[80] So well
understood between Canning and Jackson was the nature of the
service, that Jackson asked and received as a condition of his
acceptance the promise that his employment should last not less
than twelve months.[81] The delicate enterprise of which he spoke
could have been nothing more than that of preventing a rupture
between England and America; but until he studied his instructions,
he could hardly have known in its full extent how desperate this
undertaking would be.
Canning made no haste. Nearly two months elapsed before
Jackson sailed. After correcting Erskine’s mistake and replacing the
United States in their position under the Orders in Council of April
26, Canning, June 13, made a statement to the House of Commons.
Declining to touch questions of general policy for the reason that
negotiations were pending, he contented himself with satisfying the
House that Erskine had acted contrary to instructions and deserved
recall. James Stephen showed more clearly the spirit of Government
by avowing the opinion “that America in all her proceedings had no
wish to promote an impartial course with respect to France and this
country.” The Whigs knew little or nothing of the true facts; Erskine’s
conduct could not be defended; no one cared to point out that
Canning left to America no dignified course but war, and public
interest was once more concentrated with painful anxiety on the
continent of Europe. America dropped from sight, and Canning’s last
and worst acts toward the United States escaped notice or
knowledge.
The session of Parliament ended June 21, a week before the
special session of Congress came to an end; and while England
waited impatiently for news from Vienna, where Napoleon was
making ready for the battle of Wagram, Canning drew up the
instructions to Jackson,—the last of the series of papers by which,
through the peculiar qualities of his style even more than by the
violence of his acts, he embittered to a point that seemed altogether
contrary to their nature a whole nation of Americans against the
nation that gave them birth. If the famous phrase of Canning was
ever in any sense true,—that he called a new world into existence to
redress the balance of the old,—it was most nearly true in the sense
that his instructions and letters forced the United States into a
nationality of character which the war of the Revolution itself had
failed to give them.
The instructions to Jackson[82]—five in number—were dated July
1, and require careful attention if the train of events which brought
the United States to the level of war with England is to be
understood.
The first instruction began by complaint of Erskine’s conduct,
passing quickly to a charge of bad faith against the American
government, founded on “the publicity so unwarrantably given” to
Erskine’s arrangement:—
“The premature publication of the correspondence by the American
government so effectually precluded any middle course of explanation
and accommodation that it is hardly possible to suppose that it must
not have been resorted to in a great measure with that view.
“The American government cannot have believed that such an
arrangement as Mr. Erskine consented to accept was conformable to
his instructions. If Mr. Erskine availed himself of the liberty allowed to
him of communicating those instructions on the affair of the Orders in
Council, they must have known that it was not so; but even without
such communication they cannot by possibility have believed that
without any new motive, and without any apparent change in the
dispositions of the enemy, the British government could have been
disposed at once and unconditionally to give up the system on which
they have been acting, and which they had so recently refused to
relinquish, even in return for considerations which though far from
being satisfactory were yet infinitely more so than anything which can
be supposed to have been gained by Mr. Erskine’s arrangement.”
Canning attributed this conduct to a hope held by President
Madison that the British government would feel itself compelled,
however reluctantly, to sanction an agreement which it had not
authorized. In this case the American government had only itself to
blame for the consequences:—
“So far, therefore, from the American government having any
reason to complain of the non-ratification of Mr. Erskine’s
unauthorized agreement, his Majesty has on his part just ground of
complaint for that share of the inconvenience from the publication
which may have fallen upon his Majesty’s subjects, so far as their
interests may have been involved in the renewed speculations of their
American correspondents; and his Majesty cannot but think any
complaint, if any should be made on this occasion in America, the
more unreasonable, as the government of the United States is that
government which perhaps of all others has most freely exercised the
right of withholding its ratification from even the authorized acts of its
own diplomatic agents.”
In this spirit Jackson was to meet any “preliminary discussion”
which might arise before he could proceed to negotiation. Canning
did not touch on the probability that if Jackson met preliminary
discussion in such a spirit as this, he would run something more than
a risk of never reaching negotiation at all; or if Canning considered
this point, he treated it orally. The other written instructions given to
Jackson dealt at once with negotiation.
The “Chesapeake” affair came first in order, and was quickly
dismissed. Jackson was to require from the President a written
acknowledgment that the interdict on British ships was annulled
before any settlement could be made. The Orders in Council came
next, and were the subject of a long instruction, full of interest and
marked by many of Canning’s peculiarities. Once more he explained
that Erskine had inverted the relation of things by appearing to recall
the orders as an inducement to the renewal of trade,—“as if in any
arrangement, whether commercial or political, his Majesty could
condescend to barter objects of national policy and dignity for
permission to trade with another country. The character even more
than the stipulations of such a compact must under any
circumstances have put out of question the possibility of his
Majesty’s consenting to confirm it.” He related the history of the
orders, which he called “defensive retaliation,” and explained why
Erskine’s arrangement failed to effect the object of that system:—
“In the arrangement agreed to by Mr. Erskine the incidental
consequence is mistaken for the object of the negotiation. His Majesty
is made by his minister to concede the whole point in dispute by the
total and unconditional recall of the Orders in Council; and nothing is
done by the United States in return except to permit their citizens to
renew their commercial intercourse with Great Britain. Whereas,
before his Majesty’s consent to withdraw or even to modify the Orders
in Council was declared, the United States should have taken upon
themselves to execute in substance the objects of the Orders in
Council by effectually prohibiting all trade between their citizens and
France, or the Powers acting under her decrees, and by engaging for
the continuance of that prohibition so long as those decrees should
continue unrepealed.”
As in the “Chesapeake” affair, so in regard to the orders,—
Canning’s objection to Erskine’s arrangement was stated as one of
form. That the “Chesapeake” proclamation was no longer in force;
that Congress had effectually prohibited trade with France; and that
the President had engaged as far as he could to continue that
prohibition till the French Decrees were repealed,—these were
matters of notoriety. England took the ground that the United States
were liable to the operation of the British retaliatory orders against
France, even though Congress should have declared war upon
France, unless the declaration of war was regularly made known to
the British minister at Washington, and unless “the United States
should have taken upon themselves,” by treaty with England, to
continue the war till France repealed her decrees.
Canning was happy in the phrase he employed in Parliament,
March 6, to justify the course of ministers toward America.
“Extension of the law of nations” described well the Orders in Council
themselves; but the instruction to Jackson was remarkable as a
prodigious extension of the extended orders. The last legal plea was
abandoned by these instructions, and the subject would have been
the clearer for that abandonment were it not that owing to the rapidity
of events the new extravagance was never known; with Canning
himself the subject slipped from public view, and only the mystery
remained of Canning’s objects and expectations.
Another man would have temporized, and would have offered
some suggestion toward breaking the force of such a blow at a
friendly people. Not only did Canning make no new suggestion, but
he even withdrew that which he had made in February. He told
Jackson to propose nothing whatever:—
“You are to inform the American Secretary of State that in the
event of the government of the United States being desirous now to
adopt this proposal, you are authorized to renew the negotiation and
to conclude it on the terms of my instructions to Mr. Erskine; but that
you are not instructed to press upon the acceptance of the American
government an arrangement which they have so recently declined,
especially as the arrangement itself is become less important, and the
terms of it less applicable to the state of things now existing.”
The remainder of this despatch was devoted to proving that, the
late order of April 26 had so modified that of November, 1807, as to
remove the most serious American objections; and although the
blockade was more restrictive than the old orders as concerned
French and Dutch colonies, yet the recent surrender of Martinique
had reduced the practical hardship of this restriction so considerably
that it was fairly offset by the opening of the Baltic. America had the
less inducement to a further arrangement which could little increase
the extent of her commerce, while England was indifferent provided
she obtained her indispensable objects:—
“I am therefore not to direct you to propose to the American
government any formal agreement to be substituted for that which his
Majesty has been under the necessity of disavowing. You are,
however, at liberty to receive for reference home any proposal which
the American government may tender to you; but it is only in the case
of that proposal comprehending all the three conditions which Mr.
Erskine was instructed to require.”
The fourth instruction prescribed the forms in which such an
arrangement, if made, must be framed. The fifth dealt with another
branch of the subject,—the Rule of 1756. Canning declined to accept
a mere understanding in regard to this rule. Great Britain would insist
on her right to prohibit neutral trade with enemies’ colonies, “of which
she has permitted the exercise only by indulgence; ... but the
indulgence which was granted for peculiar and temporary reasons
being now withdrawn, the question is merely whether the rule from
which such an indulgence was a deviation shall be established by
the admission of America or enforced as heretofore by the naval
power of Great Britain.” As a matter of courtesy the British
government had no objection to allowing the United States to
sanction by treaty the British right, so that legal condemnations
should be made under the authority of the treaty instead of an Order
in Council; “but either authority is sufficient. No offence is taken at
the refusal of the United States to make this matter subject of
compact. The result is that it must be the subject of an Order in
Council.”
The result was that it became the subject of a much higher
tribunal than his Majesty’s Council, and that the British people, and
Canning himself, took great offence at the refusal of the United
States to make it a subject of one-sided compact; but with this
concluding touch Canning’s official irony toward America ended, and
he laid down his pen. About the middle of June, Jackson with three
well-defined casus belli in his portfolio, and another—that of
impressments—awaiting his arrival, set sail for America on the
errand which he strangely hoped might not be desperate. With his
departure Canning’s control of American relations ceased. At the
moment when he challenged for the last time an instant declaration
of war from a people who had no warmer wish than to be permitted
to remain his friends, the career of the Administration to which he
belonged came to an end in scandalous disaster.
Hardly had the Duke of York stopped one source of libel, by
resigning May 16 his office of commanderin-chief, when fresh

You might also like