100% found this document useful (2 votes)
83 views

Learning Modern C++ for Finance: Foundations for Quantitative Programming (Fourth Early Release) 4th Edition Daniel Hanson instant download

The document provides an overview of the book 'Learning Modern C++ for Finance' by Daniel Hanson, which focuses on using C++ for quantitative programming in finance. It discusses the evolution of C++ in the financial sector, its advantages over other programming languages, and the modern features introduced in recent C++ standards. Additionally, it aims to debunk common myths about C++ and highlights the importance of the C++ Standard Library for financial modeling and risk calculations.

Uploaded by

sujuanxynos97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (2 votes)
83 views

Learning Modern C++ for Finance: Foundations for Quantitative Programming (Fourth Early Release) 4th Edition Daniel Hanson instant download

The document provides an overview of the book 'Learning Modern C++ for Finance' by Daniel Hanson, which focuses on using C++ for quantitative programming in finance. It discusses the evolution of C++ in the financial sector, its advantages over other programming languages, and the modern features introduced in recent C++ standards. Additionally, it aims to debunk common myths about C++ and highlights the importance of the C++ Standard Library for financial modeling and risk calculations.

Uploaded by

sujuanxynos97
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 41

Learning Modern C++ for Finance: Foundations for

Quantitative Programming (Fourth Early Release)


4th Edition Daniel Hanson download

https://ebookmeta.com/product/learning-modern-c-for-finance-
foundations-for-quantitative-programming-fourth-early-
release-4th-edition-daniel-hanson/

Download more ebook from https://ebookmeta.com


We believe these products will be a great fit for you. Click
the link to download now, or visit ebookmeta.com
to discover even more!

Probabilistic Machine Learning for Finance and


Investing - EARLY RELEASE 1st Edition Deepak Kanungo

https://ebookmeta.com/product/probabilistic-machine-learning-for-
finance-and-investing-early-release-1st-edition-deepak-kanungo/

Learning Functional Programming (Fifth Early Release)


Jack Widman

https://ebookmeta.com/product/learning-functional-programming-
fifth-early-release-jack-widman/

C# Cookbook: Modern Recipes for Professional Developers


(Early Release) 1 / Fifth Release: 2021-06-30 Edition
Joe Mayo

https://ebookmeta.com/product/c-cookbook-modern-recipes-for-
professional-developers-early-release-1-fifth-
release-2021-06-30-edition-joe-mayo/

MANUAL OF HOUSING LAW. 11th Edition Andrew. Arden

https://ebookmeta.com/product/manual-of-housing-law-11th-edition-
andrew-arden/
Landfall 230 Aotearoa New Zealand Arts and Letters 1st
Edition David Eggleton

https://ebookmeta.com/product/landfall-230-aotearoa-new-zealand-
arts-and-letters-1st-edition-david-eggleton/

Telecom Extreme Transformation The Road to a Digital


Service Provider 1st Edition Hushyar Kaveh Braun Harald
Eslambolchi Hossein

https://ebookmeta.com/product/telecom-extreme-transformation-the-
road-to-a-digital-service-provider-1st-edition-hushyar-kaveh-
braun-harald-eslambolchi-hossein/

The Routledge Companion to Video Game Studies, 2nd


Edition Mark J. P. Wolf

https://ebookmeta.com/product/the-routledge-companion-to-video-
game-studies-2nd-edition-mark-j-p-wolf/

Blissful Masquerade 1st Edition Elira Firethorn

https://ebookmeta.com/product/blissful-masquerade-1st-edition-
elira-firethorn/

Female and Male Contraception 1st Edition Maria


Cristina Meriggiola

https://ebookmeta.com/product/female-and-male-contraception-1st-
edition-maria-cristina-meriggiola/
Step Above the Rest Yours Everlasting Series 19 1st
Edition Haven Rose

https://ebookmeta.com/product/step-above-the-rest-yours-
everlasting-series-19-1st-edition-haven-rose/
Learning Modern C++ for
Finance
Foundations for Quantitative Programming

With Early Release ebooks, you get books in their earliest form—the
author’s raw and unedited content as they write—so you can take
advantage of these technologies long before the official release of these
titles.

Daniel Hanson
Learning Modern C++ for Finance
by Daniel Hanson
Copyright © 2023 Daniel Hanson. All rights reserved.
Printed in the United States of America.
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North,
Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales
promotional use. Online editions are also available for most titles (
http://oreilly.com ). For more information, contact our corporate/institutional
sales department: 800-998-9938 or corporate@oreilly.com .

Editors: Jeff Bleiel and Amanda Quinn

Production Editor: Ashley Stussy

Interior Designer: David Futato

Cover Designer: Karen Montgomery

Illustrator: Kate Dullea

July 2023: First Edition

Revision History for the First Edition


2022-04-27: First Release
2022-06-15: Second Release
2022-11-29: Third Release
2023-02-08: Fourth Release
See http://oreilly.com/catalog/errata.csp?isbn=9781098100803 for release
details.
The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. Learning
Modern C++ for Finance, the cover image, and related trade dress are
trademarks of O’Reilly Media, Inc.
The views expressed in this work are those of the author, and do not represent
the publisher’s views. While the publisher and the author have used good
faith efforts to ensure that the information and instructions contained in this
work are accurate, the publisher and the author disclaim all responsibility for
errors or omissions, including without limitation responsibility for damages
resulting from the use of or reliance on this work. Use of the information and
instructions contained in this work is at your own risk. If any code samples or
other technology this work contains or describes is subject to open source
licenses or the intellectual property rights of others, it is your responsibility to
ensure that your use thereof complies with such licenses and/or rights.
978-1-098-10080-3
Chapter 1. An Overview of C++

A NOTE FOR EARLY RELEASE READERS


With Early Release ebooks, you get books in their earliest form—the
author’s raw and unedited content as they write—so you can take
advantage of these technologies long before the official release of these
titles.
This will be the 1st chapter of the final book. Please note that the GitHub
repo will be made active later on.
If you have comments about how we might improve the content and/or
examples in this book, or if you notice missing material within this
chapter, please reach out to the author at
learnmodcppfinance@gmail.com.

Before launching into programming in C++, it will be useful to present a


brief overview of the language the C++ Standard Library, and the ways in
which C++ continues to have a major presence in quantitative finance.
You may have already felt intimidated by opinions and rumors claiming that
C++ is extraordinarily difficult to learn and fraught with minefields. So, in
this chapter, we will try to allay these fears by first debunking some of the
common myths about C++, and then presenting straightforward examples to
help you get up and running.
Most of the content here is likely familiar for most readers, but the discussion
here attempts to extend some of the basics with points about quantitative
programming and best practices that often are not included in introductory
books. We will also have our first look at C++20, namely mathematical
constants that have been added to the C++ Standard Library.
By the end of the chapter, you should be able to write, compile, and run
simple C++ programs, understand basic numerical types, and employ
mathematical functions in the Standard Library that are fundamental in just
about any quantitative discipline, including finance.

C++ and Quantitative Finance


C++ started its rapid growth in the financial sector around the mid-1990’s.
Many of us who were in the industry around this time had been raised on
FORTRAN, particularly for writing numerical routines and scientific
applications. While FORTRAN and its supporting libraries were very well-
developed in terms of mathematical and linear algebra support, it lacked
support for object-oriented programming.
Financial modeling in the abstract is naturally comprised of different
components that interact with each other. For example, to price even a simple
derivative contract based on foreign exchange and interest rates, one would
typically require the following:
The term structure of interest rates for each currency
A market rate feed of live foreign exchange rate quotes
Volatility curves or surfaces for movements in FX rates and interest
rates
A set of pricing methods, eg closed form, simulation, or other numerical
approximations
Each of these components can be represented by an object, and C++ provided
the means for creating these objects and managing their relationships to each
other.
Banks and other financial institutions also needed a way to calculate risk
measures at both a regional and global scale. This was a particular challenge
for companies with trading operations spread across the major financial
centers of New York, London, and Tokyo, as well as other capital markets.
At the start of each trading day, risk reporting was required for a firm’s
headquarters in, say, New York that took into account the portfolios
maintained both locally and around the world. This could be a
computationally intensive task, but the performance of C++ made it possible
and was yet another significant factor in its early adoption in the financial
industry.
Around the turn of the century, newer object-oriented languages, such as Java
and C#, made software development a relatively simpler and faster process,
while more efficient processors became less expensive. However, the same
features in these languages that enabled quicker deployment, such as built-in
managed memory and intermediate compilation, could also introduce
overhead in terms of run-time performance. Management decisions on which
language to adopt often came down to a trade-off between more rapid
development and run-time efficiency. Even if one of these language
alternatives was employed, computationally intensive pricing models and risk
calculations were -- and still are -- often delegated to existing C++ libraries
and called via an interface. It should also be noted that C++ also offers
certain compile-time optimizations that are not available in these other
programming languages.

C++ 11: The Modern Era is Born


In 2011, the Standard C++ Foundation released a substantial revision that
addressed long-needed modernization and in particular provided some very
welcome abstractions that are immediately useful to quantitative developers.
These include:
Random number generation from a variety of probability distributions
Lambda expressions that encapsulate mathematical functions that can
also be passed as arguments
Task-based concurrency that can parallelize computations without the
need for manual thread management
Smart pointers that prevent memory-related program crashes, without
affecting performance
These topics and more will be discussed in the chapters ahead. An excellent
reference that covers the history and evolution of C++ into the modern era is
also available from O’Reilly: C++ Today: The Beast is Back, by Jon Kalb
and Gasper Azman [1]. It should also be noted that with more attention to,
and promotion of best practices[1] and guidelines[2] by the ISO C++
committee, cross-platform development is now a much easier task than in
years past.
And following C++11, new releases with more and more modern features
addressing the demands of financial and data science industries are being
rolled out on a threeyear cadence, with the most recent release being C++20.
This book will primarily cover developments through C++20, particularly
those that should be of interest to financial quant developers. Proposals
currently in the works for future standards are also mentioned where relevant.
Proprietary and high-frequency trading firms have been at the forefront of
adopting the C++11 Standard and later, where the speed of acting on market
and trading book signals in statistical strategies can mean a profound
difference in profit and loss. Modern C++ is also in keen demand for
derivatives pricing models utilized by traders and risk managers at
investment banks and hedge funds. The recent random number generation
and concurrency features in the Standard Library, for example, provide built-
in support for efficient Monte Carlo simulation that is a key component in
both evaluating trading strategies and pricing complex exotic options. These
tasks used to require many more hours of distributional random number
generation code development and time-consuming integration of platform-
dependent threading libraries.

Open Source Mathematical Libraries


Another very welcome development over the past decade has been the
proliferation of robust open-source mathematical libraries written in standard
C++ that therefore do not require the time-consuming C-language interface
gymnastics of the past. Primary among these are the Boost libraries, the
Eigen and Armadillo matrix algebra libraries, and machine learning libraries
such as TensorFlow and PyTorch. We will cover Boost and Eigen in more
detail later in the book.

Debunking Myths About C++


There are a multitude of myths about C++. Here are several of the more
infamous beliefs, and explanations which debunk them.
Knowledge of C is necessary for learning C++: While the C++ Standard
retains most of the C language, it is entirely possible to learn C++
without knowledge of C, as we shall see. Clinging to C style can in fact
hinder learning the powerful abstractions and potential benefits of C++.
C++ is too difficult: There is no doubt that C++ is a rich language that
provides plenty of the proverbial rope with which one can hang oneself,
but by leveraging _modern_ features of the language while holding
legacy issues in abeyance at the outset, it is entirely possible to become
very productive as a quantitative developer in C++ very quickly.
Memory leaks are always a problem in C++: With smart pointers
available since C++11, this no longer needs to be an issue in most
financial model implementations, as we shall see.

Compiled vs Interpreted Code


As alluded to above, C++ is a compiled language, where commands typed
into a file by us mere mortals are translated into binary instructions, or
machine code, that a computer processor will understand. This is in contrast
to non-typed and interpreted quantitative languages such as Python, R, and
Matlab, where each line of code must be individually translated to machine
code at run-time, thus slowing down execution time for larger applications.
This is by no means a knock on these languages, as their power is evident in
their popularity for rapid implementations of models arising in quantitative
fields such as finance, data science, and biosciences, with their built-in
mathematical and statistical functions are often compiled in C, C++, or
FORTRAN. However, the financial world at least is replete with stories
where a model would require days to run in an interpreted language, where
run times could be reduced to a matter of minutes when reimplemented in
C++.
An effective approach is to use interpreted mathematical languages with C++
in a complementary fashion. For example, when computationally intensive
models code is written in a C++ library, and then called either interactively or
from an application in R, for example, C++ efficiently takes care of the
number crunching. The results can then be used inside powerful plotting and
other visualization tools in R that are not available in C++.
Another advantage is that the models code is written once and maintained in
a C++ library that can be deployed across many different departments,
divisions, and even international boundaries, and called via interfaces from
applications in written in different front-end languages, while ensuring
consistent numerical results throughout the organization. This can be
particularly advantageous for regulatory compliance purposes.
Popular open-source C++ packages are available for both R and Python,
namely Rcpp and pybind11, respectively. Matlab also provides options for
C++ interfaces.

The Components of C++


Standard C++ releases, at a high level, consist of two components: language
features, and the C++ Standard Library. A software library is essentially a set
of functions and classes that are not executable on their own but that are
called by an application or system. Library development -- both open source
and commercial -- now dominates modern C++ development compared to
standalone applications that were popular in previous decades, and we will
discuss some of those later that are useful for computational work. The most
important C++ library is the Standard Library that is shipped with modern
compilers.
C++ Language Features
C++ language features mostly overlap with the essential operators and
constructs one would find in other programming languages, such as:
Fundamental integer and floating-point numerical types
Conditional branching: if/else if/else statements and
switch/case statements
Iterative constructs: for loops and while loops
Standard mathematical variable types: integer, double precision floating
point, etc
Standard mathematical and logical operators for numerical types:
addition, subtraction, multiplication, division, modulus, and inequalities
In addition, C++ is not limited to object-oriented programming; rather, the
language also supports the other three major programming paradigms,
namely procedural programming, generic programming, and functional
programming. Each of these will be discussed in subsequent chapters.
C++ is a strongly-typed language, meaning that before we use a variable, we
must declare it by its type. The language provides a variety of numerical
types; however, those that we will primarily use are as follows:

Minimum Maximum
Type Description Value Value

double Double +/- 2.2e-308 +/- 1.8e308


Precision

int Integer -2,147,483,648 2,147,483,647

Others, such as unsigned and extended integer types, will be introduced later
when we need them.
The C++ Standard Library
As Nicolai Josuttis describes it in his indispensable text, The C++ Standard
Library - A Tutorial and Reference, 2nd Edition[3], the C++ Standard Library
“enable(s) programmers to use general components and a higher level of
abstraction without losing portability rather than having to develop all code
from scratch.” Up through the latest C++20 release, highly useful library
features for quantitative model implementations include:
Array-style containers, particularly the venerable `vector` class
A wide set of standard algorithms that operate on these array containers,
such as sorting, searching, and efficiently applying functions to a range
of elements in a container
Standard real-valued mathematical functions such as square root,
exponential, and trigonometric functions
Complex numbers and arithmetic
Random number generation from a set of standard probability
distributions
Task-based concurrency that manages threads internally and safely
Smart pointers that abstract away the dangers associated with memory
management
A class to store and manage character data
Streaming functions to take input from and display results to the console
Use of Standard Library components, however, requires the programmer to
explicitly import them into the code, as they reside in a separate library rather
than within the core language. The idea is similar to importing a NumPy
array into a Python program or loading an external package of functions into
an R script. In C++, this is a two-step process, starting with loading the file
containing the Standard Library declarations of functions and classes we wish
to use, and then scoping these functions with the Standard Library namespace
name, `std` (often pronounced as “stood” by C++ developers).

Compilers and IDE’s


In order to get started with learning C++, you will need to obtain a compiler
and a development environment. The three major modern and freely available
compilers, which ship with their implementations of the C++ Standard
Library, are:
The Microsoft Visual Studio 2019 compiler
Clang (LLVM Project)
GNU gcc compiler
There are also several integrated development environments (IDE’s)
available, namely Visual Studio, Apple’s Xcode (which ships with the Clang
compiler), and CLion, a product that typically requires purchase from
JetBrains. For this book, Microsoft’s Visual Studio compiler and IDE are
highly recommended. They are user-friendly options to get up and running
quickly on C++, with very powerful debugging tools.
Furthermore, the Visual Studio option also includes a Clang option that
allows a programmer to switch between it and the Microsoft compiler,
helping to ensure cross-platform compatibility.
Unfortunately, the Visual Studio option for C++ only exists for Windows, as
the Mac version does not ship with a C++ option. In this case, one might opt
for downloading Apple’s Xcode, which ships with the Clang compiler. Linux
users will typically want to opt for the gcc or Clang compiler.

Basic Review of C++


The following will be a quick review of C++ using some simple code
examples. We will also have our first look at a new feature in C++20, namely
mathematical constants.
Good Old “Hello World!”
First, here is a “Hello World!” example to get started. The following code
will return the message to the screen, and then allow the user to input the
name of someone to whom to say hello:

#include <iostream>
#include <string>
int main()
{
std::cout << "Hello World!" << '\n';
std::string person;
std::cout << "To whom do you wish to say hello? ";
std::cin >> person;
std::cout << "Hello "<< person << "!" << '\n';
return 0;
}

If you want to say hello to your mother, then after compiling and running the
code, the screen would resemble the following:
Hello World!
To whom do you wish to say hello? Mom
Hello Mom!

The main review points here are


cout and cin, along with the string class, depend upon including the
C++ Standard Library declaration files iostream and string.
Members of the Standard Library need to be scoped by their namespace
std. An alternative is to put using statements with the namespace
scopes at the top of the file, indicating that anytime these elements
appear in the code, they are understood to be coming from the std
namespace. Also, you may find it easier to type endl (end of line)
rather than '\n’:

#include <iostream>
using std::cout;
using std::cin;
using std::endl;
#include <string>
using std::string;
int main()
{
cout << "Hello World!" << endl;
string person;
cout << "To whom do you wish to say hello? ";
cin >> person;
cout << "Hello " << person << "!" << endl;
return 0;
}

Importing the std namespace into the global namespace with

using namespace std;

is sometimes used to replace the individual using statements; however,


this is not considered good practice, as it can result in naming clashes at
compile time. The motivation behind namespaces will be presented in
Chapter 3.
Output to and input from the console is almost never used in production-
level financial programming. User input data will typically come from
graphical user interfaces (GUIs) or web applications, while market data
usually comes from live feeds. Results are typically displayed in the user
interface and then stored in a database, such as when a trade in executed.
We will use cout and cin to sometimes mimic these inputs, but they
should be avoided in production code.

Simple Procedural Programming in C++


Another Random Scribd Document
with Unrelated Content
By Lewis Carroll
SYLVIE AND BRUNO
CHAPTER 1. LESS BREAD! MORE TAXES!
CHAPTER 2. L'AMIE INCONNUE.
CHAPTER 3. BIRTHDAY-PRESENTS.
CHAPTER 4. A CUNNING CONSPIRACY.
CHAPTER 5. A BEGGAR'S PALACE.
CHAPTER 6. THE MAGIC LOCKET.
CHAPTER 7. THE BARONS EMBASSY.
CHAPTER 8. A RIDE ON A LION.
CHAPTER 9. A JESTER AND A BEAR.
CHAPTER 10. THE OTHER PROFESSOR.
CHAPTER 11. PETER AND PAUL.
CHAPTER 12. A MUSICAL GARDENER.
CHAPTER 13. A VISIT TO DOGLAND.
CHAPTER 14. FAIRY-SYLVIE.
CHAPTER 15. BRUNO'S REVENGE.
CHAPTER 16. A CHANGED CROCODILE.
CHAPTER 17. THE THREE BADGERS.
CHAPTER 18. QUEER STREET, NUMBER FORTY.
CHAPTER 19. HOW TO MAKE A PHLIZZ.
CHAPTER 20. LIGHT COME, LIGHT GO.
CHAPTER 21. THROUGH THE IVORY DOOR.
CHAPTER 22. CROSSING THE LINE.
CHAPTER 23. AN OUTLANDISH WATCH.
CHAPTER 24. THE FROGS' BIRTHDAY-TREAT.
CHAPTER 25. LOOKING EASTWARD.
PREFACE.

SYLVIE AND BRUNO


By Lewis Carroll
With Forty-Six Illustrations

CONTENTS

CHAPTER
I. LESS BREAD! MORE TAXES! 1
II. L’AMIE INCONNUE 16
III. BIRTHDAY-PRESENTS 29
IV. A CUNNING CONSPIRACY 43
V. A BEGGAR’S PALACE 56
VI. THE MAGIC LOCKET 73
VII. THE BARON’S EMBASSY 87
VIII. A RIDE ON A LION 100
IX. A JESTER AND A BEAR 113
X. THE OTHER PROFESSOR 129
XI. PETER AND PAUL 143
XII. A MUSICAL GARDENER 156
XIII. A VISIT TO DOGLAND 171
XIV. FAIRY-SYLVIE 187
XV. BRUNO’S REVENGE 207
XVI. A CHANGED CROCODILE 222
XVII. THE THREE BADGERS 234
XVIII. QUEER STREET, NUMBER FORTY 255
XIX. HOW TO MAKE A PHLIZZ 271
XX. LIGHT COME, LIGHT GO 287
XXI. THROUGH THE IVORY DOOR 304
XXII. CROSSING THE LINE 325
XXIII. AN OUTLANDISH WATCH 345
XXIV. THE FROGS’ BIRTHDAY-TREAT 361
XXV. LOOKING EASTWARD 383
Index 396

SYLVIE AND BRUNO


(CONCLUDED)
By Lewis Carroll
With Forty-Six Illustrations By Harry Furniss

CONTENTS.

CHAPTER PAGE
I. BRUNO’S LESSONS 1
II. LOVE’S CURFEW 20
III. STREAKS OF DAWN 36
IV. THE DOG-KING 52
V. MATILDA JANE 67
VI. WILLIE’S WIFE 82
VII. FORTUNATUS’ PURSE 96
VIII. IN A SHADY PLACE 110
IX. THE FAREWELL-PARTY 128
X. JABBERING AND JAM 147
XI. THE MAN IN THE MOON 162
XII. FAIRY-MUSIC 175
XIII. WHAT TOTTLES MEANT 194
XIV. BRUNO’S PICNIC 212
XV. THE LITTLE FOXES 233
XVI. BEYOND THESE VOICES 247
XVII. TO THE RESCUE! 262
XVIII. A NEWSPAPER-CUTTING 282
XIX. A FAIRY-DUET 287
XX. GAMMON AND SPINACH 310
XXI. THE PROFESSOR’S LECTURE 329
XXII. THE BANQUET 346
XXIII. THE PIG-TALE 363
XXIV. THE BEGGAR’S RETURN 381
XXV. LIFE OUT OF DEATH 400
General Index 413
List of Works 426

ILLUSTRATIONS TO VOL. I.

THE MARCH-UP 3
VISITING THE PROFESSOR 11
BOOTS FOR HORIZONTAL WEATHER 15
A PORTABLE PLUNGE-BATH 24
REMOVAL OF UGGUG 41
‘WHAT A GAME!’ 48
‘DRINK THIS!’ 53
‘COME, YOU BE OFF!’ 62
THE GARDENER 66
A BEGGAR’S PALACE 72
THE CRIMSON LOCKET 77
‘HE THOUGHT HE SAW A BUFFALO’ 79
‘IT WAS A HIPPOPOTAMUS’ 91
THE MAP OF FAIRYLAND 96
‘HE THOUGHT HE SAW A KANGAROO’ 106
THE MOUSE-LION 108
‘HAMMER IT IN!’ 115
A BEAR WITHOUT A HEAD 117
‘COME UP, BRUIN!’ 123
THE OTHER PROFESSOR 135
‘HOW CHEERFULLY THE BOND HE SIGNED!’ 144
‘POOR PETER SHUDDERED IN DESPAIR’ 147
‘SUCH BOOTS AS THESE YOU SELDOM SEE’ 150
‘I WILL LEND YOU FIFTY MORE!’ 154
‘HE THOUGHT HE SAW AN ALBATROSS’ 165
THE MASTIFF-SENTINEL 172
THE DOG-KING 176
FAIRY-SYLVIE 193
BRUNO’S REVENGE 213
FAIRIES RESTING 226
A CHANGED CROCODILE 229
A LECTURE ON ART 240
‘THREE BADGERS ON A MOSSY STONE’ 247
‘THE FATHER-BADGER, WRITHING IN A CAVE’ 249
‘THOSE AGED ONES WAXED GAY’ 252
‘HOW PERFECTLY ISOCHRONOUS!’ 268
THE LAME CHILD 280
‘IT WENT IN TWO HALVES’ 285
FIVE O’CLOCK TEA 296
‘WHAT’S THE MATTER, DARLING?’ 307
THE DEAD HARE 321
CROSSING THE LINE 341
‘THE PUG-DOG SAT UP’ 351
THE QUEEN’S BABY 363
THE FROGS’ BIRTHDAY-TREAT 373
‘HE WRENCHED OUT THAT CROCODILE’S TOOF!’ 380
‘LOOK EASTWARD!’ 395

ILLUSTRATIONS TO VOL. II.

SYLVIE’S TRUANT-PUPIL 8
KING FISHER’S WOOING 15
‘SPEND IT ALL FOR MINNIE’ 22
‘ARE NOT THOSE ORCHISES?’ 50
A ROYAL THIEF-TAKER 62
‘SUMMAT WRONG WI’ MY SPECTACLES!’ 64
BESSIE’S SONG 75
THE RESCUE OF WILLIE 83
WILLIE’S WIFE 88
FORTUNATUS’ PURSE 103
‘I AM SITTING AT YOUR FEET’ 119
MEIN HERR’S FAIRY-FRIENDS 163
‘HOW CALL YOU THE OPERA?’ 178
SCHOLAR-HUNTING: THE PURSUED 188
SCHOLAR-HUNTING: THE PURSUERS 189
THE EGG-MERCHANT 197
STARTING FOR BRUNO’S PICNIC 230
‘ENTER THE LION’ 236
‘WHIHUAUCH! WHIHUAUCH!’ 242
‘NEVER!’ YELLED TOTTLES 248
BRUNO’S BED-TIME 265
‘LONG CEREMONIOUS CALLS’ 266
THE VOICES 267
‘HIS SOUL SHALL BE SAD FOR THE SPIDER’ 268
LORDS OF THE CREATION 271
‘WILL YOU NOT SPARE ME?’ 277
IN THE CHURCH-YARD 291
A FAIRY-DUET 304
THE OTHER PROFESSOR FOUND 317
‘HER IMPERIAL HIGHNESS IS SURPRISED!’ 326
‘HE THOUGHT HE SAW AN ELEPHANT’ 335
AN EXPLOSION 345
‘A CANNOT SHAK’ HANDS WI’ THEE!’ 350
THE OTHER PROFESSOR’S FALL 352
‘TEACHING TIGRESSES TO SMILE’ 365
‘HORRID WAS THAT PIG’S DESPAIR!’ 367
THE FATAL JUMP 369
‘BATHING CROCODILES IN CREAM’ 371
‘THAT PIG LAY STILL AS ANY STONE’ 372
‘STILL HE SITS IN MISERIE’ 373
‘BLESSED BY HAPPY STAGS’ 377
THE OLD BEGGAR’S RETURN 382
‘PORCUPINE!’ 388
‘GOOD-NIGHT, PROFESSOR!’ 398
‘HIS WIFE KNELT DOWN AT HIS SIDE’ 404
THE BLUE LOCKET 409
‘IT IS LOVE!’ 411

PHANTASMAGORIA AND
OTHER POEMS
By Lewis Carroll
Illustrations By Arthur B. Frost
CONTENTS

PAGE
Phantasmagoria, in Seven Cantos:—
I. The Trystyng 1
II. Hys Fyve Rules 10
III. Scarmoges 18
IV. Hys Nouryture 26
V. Byckerment 34
VI. Dyscomfyture 44
VII. Sad Souvenaunce 53
Echoes 58
A Sea Dirge 59
Ye Carpette Knyghte 64
Hiawatha’s Photographing 66
Melancholetta 78
A Valentine 84
The Three Voices:—
The First Voice 87
The Second Voice 98
The Third Voice 109
Tèma Con Variaziòni 118
A Game of Fives 120
Poeta fit, non nascitur 123
Size and Tears 131
Atalanta in Camden-Town 136
The Lang Coortin’ 140
Four Riddles 152
Fame’s Penny-Trumpet 163

THE GAME OF LOGIC


By Lewis Carroll

CONTENTS

CHAPTER PAGE

I. NEW LAMPS FOR OLD.


1. Propositions . . . . . . . 1 . . . . .
2. Syllogisms . . . . . . . . 20
3. Fallacies . . . . . . . . 32

II. CROSS QUESTIONS.


1. Elementary . . . . . . . . 37
2. Half of Smaller Diagram. Propositions
to be represented . . . . . 40
3. Do. Symbols to be interpreted. . 42
4. Smaller Diagram. Propositions to be
represented . . . . . . . 44
5. Do. Symbols to be interpreted. . 46
6. Larger Diagram. Propositions to be
represented . . . . . . . 48
7. Both Diagrams to be employed . . 51

III. CROOKED ANSWERS.


1. Elementary . . . . . . . . 55
2. Half of Smaller Diagram. Propositions
represented . . . . . . . 59
3. Do. Symbols interpreted . . . 61
4. Smaller Diagram. Propositions
represented. 62
5. Do. Symbols interpreted . . . 65
6. Larger Diagram. Propositions
represented. 67
7. Both Diagrams employed . . . . 72

IV. HIT OR MISS . . . . . . . . . 85


A TANGLED TALE
By Lewis Carroll
CONTENTS

KNOT PAGE
I. Excelsior 1
II. Eligible Apartments 4
III. Mad Mathesis 13
IV. The Dead Reckoning 19
V. Oughts and Crosses 27
VI. Her Radiancy 34
VII. Petty Cash 43
VIII. De Omnibus Rebus 52
IX. A Serpent with Corners 58
X. Chelsea Buns 66

Answers to Knot I. 77
" " II. 84
" " III. 90
" " IV. 96
" " V. 102
" " VI. 106
" " VII. 112
" " VIII. 132
" " IX. 135
" " X. 142
RHYME? AND REASON?
By Lewis Carroll
WITH ILLUSTRATIONS
CONTENTS.
PAGE
Phantasmagoria, in Seven Cantos:—
I. The Trystyng 1
II. Hys Fyve Rules 10
III. Scarmoges 18
IV. Hys Nouryture 26
V. Byckerment 34
VI. Dyscomfyture 44
VII. Sad Souvenaunce 53
Echoes 58
A Sea Dirge 59
Ye Carpette Knyghte 64
Hiawatha’s Photographing 66
Melancholetta 78
A Valentine 84
The Three Voices:
The First Voice 87
The Second Voice 98
The Third Voice 109
Tèma Con Variazióni 118
A Game of Fives 120
Poeta fit, non nascitur 123
The Hunting of the Snark, an Agony in Eight Fits:—
I. The Landing 134
II. The Bellman’s Speech 142
III. The Baker’s Tale 148
IV. The Hunting 153
V. The Beaver’s Lesson 159
VI. The Barrister’s Dream 167
VII. The Banker’s Fate 173
VIII. The Vanishing 177
Size and Tears 181
Atalanta in Camden Town 186
The Lang Coortin’ 190
Four Riddles 202
Fame’s Penny-Trumpet 211

THREE SUNSETS AND OTHER


POEMS
By Lewis Carroll
WITH TWELVE FAIRY-FANCIES

You might also like