100% found this document useful (1 vote)
55 views

Functional Programming in JavaScript How to improve your JavaScript programs using functional techniques 1st Edition Luis Atenciopdf download

The document is a promotional text for the book 'Functional Programming in JavaScript' by Luis Atencio, which aims to enhance JavaScript programming through functional techniques. It includes links to download the book and other related titles, along with a brief overview of the book's contents and structure. Additionally, it provides information about the publisher, Manning Publications Co.

Uploaded by

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

Functional Programming in JavaScript How to improve your JavaScript programs using functional techniques 1st Edition Luis Atenciopdf download

The document is a promotional text for the book 'Functional Programming in JavaScript' by Luis Atencio, which aims to enhance JavaScript programming through functional techniques. It includes links to download the book and other related titles, along with a brief overview of the book's contents and structure. Additionally, it provides information about the publisher, Manning Publications Co.

Uploaded by

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

Functional Programming in JavaScript How to

improve your JavaScript programs using


functional techniques 1st Edition Luis Atencio
pdf download
https://ebookmeta.com/product/functional-programming-in-
javascript-how-to-improve-your-javascript-programs-using-
functional-techniques-1st-edition-luis-atencio/

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!

Functional Programming in JavaScript How to improve


your JavaScript programs using functional techniques
1st Edition Luis Atencio

https://ebookmeta.com/product/functional-programming-in-
javascript-how-to-improve-your-javascript-programs-using-
functional-techniques-1st-edition-luis-atencio/

Mastering JavaScript Functional Programming 1st Edition


Federico Kereki

https://ebookmeta.com/product/mastering-javascript-functional-
programming-1st-edition-federico-kereki/

Functional JavaScript 1st Edition Michael Fogus

https://ebookmeta.com/product/functional-javascript-1st-edition-
michael-fogus/

Neuroscience for Learning and Development: How to Apply


Neuroscience and Psychology for Improved Learning and
Training 3rd Edition Stella Collins

https://ebookmeta.com/product/neuroscience-for-learning-and-
development-how-to-apply-neuroscience-and-psychology-for-
improved-learning-and-training-3rd-edition-stella-collins/
ALU 101 TEXTBOOK BASIC LIFE INSURANCE UNDERWRITING
Academy Of Life Underwriting

https://ebookmeta.com/product/alu-101-textbook-basic-life-
insurance-underwriting-academy-of-life-underwriting/

The Oxford Handbook of Nigerian Politics A. Carl Levan

https://ebookmeta.com/product/the-oxford-handbook-of-nigerian-
politics-a-carl-levan/

Bedside Manner- A Small-Town, Older Man/Younger Woman


Instalove Medical Romance: May December Romance Series
1st Edition Violet Rae

https://ebookmeta.com/product/bedside-manner-a-small-town-older-
man-younger-woman-instalove-medical-romance-may-december-romance-
series-1st-edition-violet-rae/

These Vile Secrets Enclave 1 1st Edition Ce Ricci Ricci


Ce

https://ebookmeta.com/product/these-vile-secrets-enclave-1-1st-
edition-ce-ricci-ricci-ce/

The Princeton Field Guide to Dinosaurs Second Edition


Gregory S. Paul

https://ebookmeta.com/product/the-princeton-field-guide-to-
dinosaurs-second-edition-gregory-s-paul/
Mr. Park Lane (Mister #4) 1st Edition Louise Bay

https://ebookmeta.com/product/mr-park-lane-mister-4-1st-edition-
louise-bay/
www.ebook3000.com
Functional Programming in JavaScript

www.ebook3000.com

www.ebook3000.com

Functional

Programming

in JavaScript

LUIS ATENCIO

MANNING

SHELTER ISLAND

www.ebook3000.com

For online information and ordering of this and other Manning books,
please visit

www.manning.com. The publisher offers discounts on this book when


ordered in quantity.

For more information, please contact

Special Sales Department

Manning Publications Co.

20 Baldwin Road

PO Box 761

Shelter Island, NY 11964

Email: [email protected]
©2016 by Manning Publications Co. All rights reserved.

No part of this publication may be reproduced, stored in a retrieval


system, or transmitted, in any form or by means electronic,
mechanical, photocopying, or otherwise, without prior written
permission of the publisher.

Many of the designations used by manufacturers and sellers to


distinguish their products are claimed as trademarks. Where those
designations appear in the book, and Manning Publications was
aware of a trademark claim, the designations have been printed in
initial caps or all caps.

Recognizing the importance of preserving what has been written, it is


Manning’s policy to have the books we publish printed on acid-free
paper, and we exert our best efforts to that end.

Recognizing also our responsibility to conserve the resources of our


planet, Manning books are printed on paper that is at least 15
percent recycled and processed without the use of elemental
chlorine.

Manning Publications Co.

Development editor: Marina Michaels

20 Baldwin Road

Technical development editor: Dean Iverson

PO Box 761

Review editor: Aleksandar Dragosavljevic

Shelter Island, NY 11964

Project editor: Tiffany Taylor


Copy editor: Tiffany Taylor

Proofreader: Katie Tennant

Technical proofreader: Daniel Lamb

Typesetter: Dennis Dalinnik

Cover designer: Leslie Haimes

ISBN: 9781617292828

Printed in the United States of America

1 2 3 4 5 6 7 8 9 10 – EBM – 21 20 19 18 17 16

www.ebook3000.com

To my wonderful wife, Ana.

Thank you for your unconditional support

and for being the source of passion and inspiration in my life.

www.ebook3000.com

www.ebook3000.com

brief contents

PART 1

THINK FUNCTIONALLY ..................................................1

Becoming functional
3

Higher-order JavaScript

23

PART 2

GET FUNCTIONAL........................................................55

Few data structures, many operations

57

Toward modular, reusable code

84

Design patterns against complexity

117

PART 3
ENHANCING YOUR FUNCTIONAL SKILLS...................... 151

Bulletproofing your code

153

Functional optimizations

180

Managing asynchronous events and data

205

vii

www.ebook3000.com

www.ebook3000.com

contents

preface

xv

acknowledgments
xvii

about this book

xix

PART 1 THINK FUNCTIONALLY .......................................1

1 Becoming functional 3

1.1

Can functional programming help?

1.2

What is functional programming?

Functional programming is declarative

7 ■ Pure functions and

the problem with side effects

9 ■ Referential transparency and

substitutability

13 ■ Preserving immutable data

15

1.3

Benefits of functional programming


16

Encouraging the decomposition of complex tasks

16

Processing data using fluent chains

18 ■ Reacting to the

complexity of asynchronous applications

19

1.4

Summary

22

ix

www.ebook3000.com

CONTENTS

2 Higher-order JavaScript 23

2.1

Why JavaScript?

24

2.2

Functional vs. object-oriented programming


24

Managing the state of JavaScript objects

31 ■ Treating objects

as values

32 ■ Deep-freezing moving parts

34 ■ Navigating

and modifying object graphs with lenses

37

2.3

Functions

38

Functions as first-class citizens

39 ■ Higher-order functions

40

Types of function invocation

43 ■ Function methods

44

2.4

Closures and scopes

45
Problems with the global scope

47 ■ JavaScript’s function

scope

48 ■ A pseudo-block scope

49 ■ Practical applications

of closures

50

2.5

Summary

53

PART 2 GET FUNCTIONAL ............................................55

3 Few data structures, many operations 57

3.1

Understanding your application’s control flow

58

3.2

Method chaining

59

3.3

Function chaining
60

Understanding lambda expressions

61 ■ Transforming data

with _.map

62 ■ Gathering results with _.reduce

65

Removing unwanted elements with _.filter

68

3.4

Reasoning about your code

70

Declarative and lazy function chains

71 ■ SQL-like data:

functions as data

75

3.5

Learning to think recursively

77

What is recursion?

77 ■ Learning to think recursively


77

Recursively defined data structures

79

3.6

Summary

83

4 Toward modular, reusable code 84

4.1

Method chains vs. function pipelines

85

Chaining methods together

86 ■ Arranging functions

in a pipeline

87

CONTENTS

xi

4.2

Requirements for compatible functions

88

Type-compatible functions
88 ■ Functions and arity:

the case for tuples

89

4.3

Curried function evaluation

92

Emulating function factories

95 ■ Implementing reusable

function templates

97

4.4

Partial application and parameter binding

98

Extending the core language

100 ■ Binding into

delayed functions

101

4.5

Composing function pipelines

102
Understanding composition with HTML widgets

102

Functional composition: separating description from

evaluation

104 ■ Composition with functional libraries

107

Coping with pure and impure code

109 ■ Introducing point-free

programming

111

4.6

Managing control flow with functional combinators

112

Identity (I-combinator)

112 ■ Tap (K-combinator)

113

Alternation (OR-combinator)

113 ■ Sequence (S-combinator)

114

Fork (join) combinator


Discovering Diverse Content Through
Random Scribd Documents
Miss Susanna had thrown herself into the spirit of the bit of by-play
with the merry zest of a child. Since she had known Marjorie and the
light-hearted, fun-loving coterie of Hamilton girls she had appeared
to grow younger and younger. That particular, congenial galaxy of
youth Miss Susanna had taken to her heart as a charm against
crabbed old age.
“Maybe we’d better not make any resistance, Miss Susanna,” Jonas
advised with a timid air. It reduced the two desperadoes to a state of
giggles which utterly broke up their threatening aspect.
“Maybe we hadn’t,” the old lady agreed with brisk amusement. “You
sit down at the table with us and have a cup of tea, Jonas. There’s
safety in numbers.” She graciously waved Jonas into the one vacant
chair of the four around the table. Had he been her elder brother
instead of her major-domo of many years she could not have treated
him with more kindly affection.
“It’s mean in me to tease you children,” she said, flashing her guests
one of her bright smiles. “Forgive me. I’m really going to tell you all
about it now.”
“The past is forgot,” Jerry moaned ungrammatically.
“Thank you,” Miss Susanna responded gratefully. “I was hoping it
might be. Now for the tale of my adventures in New York. My lawyer,
who was young when I was, left Hamilton many years ago and
established himself in New York. His name is Richard Henry Garrett.
He never married. During our younger days we lost track of each
other. Later we met again and after Uncle Brooke’s death I engaged
him to attend to the legalities of the estate. Uncle Brooke’s lawyer
died shortly after my great uncle’s decease.
“Since the laying of the dormitory corner stone last fall,” Miss
Susanna continued, “I have often wondered what I could give the
girls who are to live there that would be of use and benefit to all.
When the dormitory is completed I shall carry out a certain wish of
Uncle Brooke’s of which at present I prefer not to speak. What I was
anxious to do was something personal for the girls’ welfare. In the
midst of my quandary I received my old friend Richard’s letter. I had
not finished reading it when the very idea I was seeking came to
me. Let me read you the paragraph of his letter which furnished my
inspiration.”
Miss Susanna drew from an ornamental ruffled silk pocket of her
skirt the folded sheets of a letter. She unfolded them; hunted them
for the desired paragraph. She quickly found it and read in her brisk
tones:
“‘Since you used to be greatly interested in old and rare books you
will remember the Ellerton’s fine private library which I once took
you to see when you were in New York. It is to be sold soon, at
auction, as a whole. The elder Ellertons have died and the heirs to
the Ellerton estate prefer to convert the library into cash. It appears
to be the chief aim of the rising generation to convert everything of
beauty and worth, which has a monetary value, into dollars,
regardless of tradition. So that splendid monument to learning,
Steven Ellerton’s library, will come under the auctioneer’s hammer
next month.’”
“I’m sure the Ellerton library couldn’t be finer than the Hamilton
Arms’ library,” Marjorie said in loyal defense of the remarkable
collection of volumes gathered together by Brooke Hamilton.
“It is not as complete, if I remember rightly,” Miss Susanna said,
looking pleased at Marjorie’s staunch opinion. “Uncle Brooke has
some rare Chinese and Japanese books and a collection of Spanish
incunabula which I know the Ellerton library lacks, as well as a good
many other rare and curious books of which he possessed the only
known copies.”
Miss Susanna’s face broke into a little, amused smile as she glanced
from one to the other of the two girls.
“You girls must surely understand by this time what my inspiration
was. You both look a trifle bewildered. Can’t you add two and two,
children?” she asked playfully. “You ought to know the result.”
“But it’s such an overwhelming result, Miss Susanna!” Marjorie drew
a long breath. “Two, which stands for the dormitory girls, plus, two,
which stands for the Ellerton library make—” Marjorie paused. She
gazed at Miss Hamilton, her eyes bright as stars. “It’s too wonderful
even to think about;—until I grow more used to the idea. It’s too
great a gift, Miss Susanna, after all you’ve already done for the
dormitory project.”
“Nonsense. Nothing is too great for me to give, provided I have it to
give, and feel like giving it,” declared the old lady brusquely. “I like
the idea of the dormitory having its own library. I have only one
request to make concerning it. I’d like to have the library named the
Brooke Hamilton Dormitory Library.”
“Just as though we could give it another name!” Marjorie exclaimed
with fond fervor. “I’d say it ought to be named for you but I know
you would rather use Mr. Brooke’s name.”
“Of course I should.” Miss Hamilton gave an emphatic little nod of
the head. “I shouldn’t like the ‘Susanna Hamilton Dormitory Library,’
as a name. Should you, child?”
“Yes; I should,” Marjorie disagreed with affectionate frankness. Jerry
echoed the opinion.
“You’re a couple of nice children. I appreciate your loyal approval,”
Miss Susanna told them. Her tones took on an odd grimness as she
added: “My name shall not appear in connection with a Hamilton
College movement, however worthy it may be. In the case of his
name, there’s a difference. He had the right to hope that his name
might be perpetuated in the college his genius and benevolence
raised up.”
“‘The college his genius and benevolence raised up,’” Marjorie
meditatively repeated. “How beautiful that would be in a biography
of Mr. Brooke Hamilton.” She flushed, but looked bravely at Miss
Susanna. She had, in thus speaking, obeyed an irresistible impulse.
Answering color signals displayed themselves in the old lady’s
cheeks. A frown sprang to her brows. It disappeared almost
instantly. Her alert dark eyes grew tender. “It was a fortunate day for
Hamilton when a certain curly-haired little girl first set foot on the
campus. Why not call the new dormitory the Marjorie Dean
Dormitory? The dream dormitory that Marjorie Dean’s unselfish work
made a reality. That’s what Uncle Brooke would say if he were here.”
“How I love you for saying that, Miss Susanna, about Mr. Brooke
Hamilton!” Marjorie cried happily. “But I think Robin has done more
hard work than I to make the dormitory a reality. It should be
named for her.”
“Don’t you ever believe it, Miss Susanna.” Jerry laid emphasis on
each word. “Marvelous Manager began it. Robin is a close second,
though. The ‘dorm’ ought to be called the Page and Dean Dormitory.
Sounds something like a business directory, but it tells the story. And
the great beauty of it is this:—it includes both distinguished
promoters.” Jerry directed a refulgent smile at Marjorie, who
promptly made a saucy mouth at her.
“The Page and Dean Dormitory,” repeated Miss Susanna with a
humorous glance at Jerry. “I rather like the sound of the
combination. You’re right about it, Jerry. When one has two such
retiring persons to deal with as Marjorie and Robin it becomes
necessary to drag them both to the front. So be it. Now for Uncle
Brooke’s study and our library catalogues. Only a limited number of
them were issued. I wish you had been with me at the auction.
There was some very brisk bidding at first. There were perhaps a
dozen wealthy New York men interested in the auction. Richard
Garrett represented me. I had nothing to do but keep quiet and
listen to the bidding.”
Miss Hamilton continued to relate in her abrupt, lively way the
interesting circumstances of the auction as they left the Chinese
room and stepped into the lift which Jonas manipulated for them.
“Send Selma to clear away the tea things, Jonas,” she ordered as
she stepped from the tiny elevator. “Then come to the study. You
must go over the catalogues with us. Nothing like familiarizing
yourself with the books you are going to pack.”
Jonas disappeared with alacrity. He returned as speedily to the
study, an utterly pleased smile decorating his placid, old face. He
was immensely proud of being invited to make a fourth member of
the group in the study.
The four friends sat at the massive, claw-legged library table and
were soon deep in exploring the copies of the auction catalogue with
which Miss Hamilton had supplied them. They read by snatches,
browsing avidly here and there among the descriptive pages;
exclaiming exultantly over one rare book or another which they
discovered listed there.
“I’m positively dizzy with pride and vanity over the dormitory’s
wonder of a present!” Marjorie’s eyes gleamed like stars. There was
a wealth of feeling in her gratefully gay utterance. Presently, she
allowed the catalogue to drop from her hands to the table. She sat
gazing at the erect little figure on the opposite side of the table with
boundless affection. “I’m sure you must love the dream dormitory
that you helped make a reality as dearly as we Travelers do,” she
said fervently.
“We’ll say I have nothing against it,” Miss Susanna said dryly. “Why
should I? It’s not on the campus.” She cast a defiant glance about
her. “But we’ll not go into that subject. Back to our library. Having
acquired it, the next thing to do is to get it here.” The independent
donor declined to hear of her own generosity. “You’d best start for
New York in the morning, Jonas,” was her next terse remark.
“What train, Miss Susanna?” Jonas inquired imperturbably.
“An early morning train. One that will bring you into New York, it
ought to be called New Pandemonium Let Loose, while daylight
lasts,” the old lady pithily replied.
Jerry and Marjorie were both smiling openly at the sudden
imperative order Miss Susanna had launched at Jonas, and its
tranquil reception.
“Yes, Jonas, for goodness sake don’t get lost in the wilds of New
York after dark,” Jerry warned with a chuckle. “I hope you know
who’s who, what’s what and where’s where in the metropolis.”
“I don’t; but I suppose I’ll have to learn.” Jonas echoed the chuckle.
His highly cheerful expression evidenced the coming detail as being
quite to his taste. “New York’s not much like it was when I was a
young man and Mr. Brooke took me there with him once for a trip.”
Two pairs of bright eyes were turned on Jonas with an expression
which bordered on reverence. It was something to marvel at—that
this stately old man with his crown of thick, snowy hair had been the
chosen traveling companion of Brooke Hamilton on a trip to New
York. Miss Susanna watched them understandingly, experiencing a
secret happiness in the unconscious girlish tribute offered her
distinguished kinsman.
“It won’t take Jonas long to find his bearings,” she confidently
predicted. “With the help of two or three workmen he can pack the
library in short order. It will have to be stored at the Arms when it
arrives, until the dormitory is completed. Jonas will see to having it
shipped to the Arms by motor van. That will save time and extra
handling. I want it here and off my mind before Christmas. I have
received an invitation from a dear friend to spend Christmas with her
and her family. I am thinking of accepting it.”
Miss Susanna peered mysteriously over her glasses at Marjorie and
Jerry. She did not offer to divulge the name of the friend. Jonas
raised a hand to his mouth as though to brush away a smile that
flickered briefly upon his lips.
“Truly, Miss Susanna?” Marjorie cried out her pleasure of the
announcement. Each year since she had come to know the old lady
well she had invited her to spend the Christmas holidays at Castle
Dean. On each occasion Miss Susanna had flatly refused to leave the
Arms over the holidays, declaring that she would not consider the
idea of passing Christmas Day away from her ancestral home.
“Yes, truly. You won’t need to worry this Christmas about my being
lonely, child. I’m going back on my vow of years’ standing. I’ve
found something stronger even than my love for the Arms. I’ve
found the love of friends.” There was exultant triumph in Miss
Hamilton’s forceful speech.
“I’m so glad,” Marjorie assured with hearty sincerity. Her cheery
smile further conveyed her unenvious spirit at the news. She could
only be glad because Miss Susanna had found such a boon. She
surmised that through the friendly offices of Richard Garrett Miss
Hamilton had come in touch again with the woman friend of whom
she had just spoken. They had of course met in New York.
“Did you meet your friend in New York, Miss Susanna?” Jerry’s
surprised curiosity got the better of her. “I don’t mean to be an old
curiosity shop,” she instantly apologized, half laughing. “I scented an
interesting story. I thought you might have met a girl chum whom
you hadn’t seen for years and years.”
“No, Jerry; I did not meet my friend in New York.” Miss Susanna
tried vainly to keep a sober face. The battery of bright, wondering
eyes turned upon her proved too much for her. She laughed; a high,
joyful little laugh in which Jonas’ deeper notes of amusement
mingled. “I first met my friend on the road to the Arms; not such a
long while ago,” she said with tender pride. “The interesting story of
our friendship began with a broken basket handle and a young girl’s
gracious courtesy toward a crusty old woman. I was very fortunate
in meeting her. She turned out to be a royal young person who lived
in a castle in the far country of Sanford. Since I’ve known her she’s
often invited me to spend Christmas at Castle Dean. I’ve stayed at
the Arms when I might have been happy in the royal palace of the
King and Queen of Dean. I—”
“Miss Susanna!” Marjorie and Jerry were now on their feet with a
concerted jubilant shriek.
“Wait a second.” Miss Hamilton briefly warded off the impending,
tumultuous embrace of two energetic pairs of arms. “One more
remark; then you may hug me hard. Like all the rest of the world, I
hope to be happy at Christmas time. I know I shall be—at Castle
Dean.”
CHAPTER XXIII.

A SIGNIFICANT DISCOVERY

“No, Beauty, I haven’t gone back on my word. How can you harbor
such suspicions against a fine old Irish gentleman like myself? Such
a regard as I have for you, yet you will doubt me.” Leila Harper
rolled reproachfully sentimental eyes at Marjorie. “Since it is a
Beauty contest you demand, your Celtic friend will rise to the
occasion.”
“I wish you’d rise soon then.” Marjorie met Leila’s effusive promise
with a coaxing smile.
“Name the day and the hour.” Leila gave vent to a resigned groan,
quite at variance with her fulsome mood of the moment before.
“There you go. One minute you blow hot; the next cold.” Marjorie
shook an arraigning finger before Leila’s face. “I’m going to take you
at your word and name the day and hour. The day will be next
Friday. The hour, eight P.M. The place, the gym, the promoters of
the contest—” Marjorie paused with a dubious, questioning look
toward Leila.
“Aye, Beauty; there’s the rub!” Leila exclaimed. “The contest ought
to be pulled off by either the sophs or freshies. We P. G.’s are
beyond such trifling vanities. So some would be pleased to say we
should be. Now we come to the reason why of things. I’m wisely in
favor of letting the sophs perpetrate the beauty walk.”
“My own opinion,” Marjorie concurred. “How would you turn it over
to them and still manage it, Leila. I mean the details. Only you know
how to manage a Beauty contest like the one you got up long ago.”
“I’m going to be the power behind the throne and manage the
contest through the Bertram girls,” Leila made shrewd declaration.
“They are popular sophs. Besides they will do as I tell them. They’ll
not spoil my fine arrangements.” Leila favored Marjorie with a
whimsical grin. “Let me warn you, beforehand, Beauty. It will be
dangerous for you to attend the contest.”
“Your warning is wasted. I shall sit in the gallery and watch the
Beauty parade. Not because I imagine for a minute that I—that I—”
Marjorie stammered, growing suddenly rosy with confusion.
“That you would certainly win it if you appeared on the gym floor,”
Leila finished with mischievous affability. “No fair decorating the
gallery, Beauty. It’s a most important part you must play on the
floor.”
“No, designing villain. You dragged me into one Beauty contest; but
never again.” She wagged a decisive head at Leila who merely
continued to beam on her.
“This time I have a fine plan for you,” Leila continued, unabashed.
“You are to be one of the judges. I’ll paint lines of age on your lovely
face; give you a snow-white frizzy wig and a shapeless brown bag of
a gown to wear. Even your captain could not pick you out as a Dean.
Now tell me, am I not your devoted Irish friend?” she demanded
ingratiatingly.
“You’re a jewel, Leila Greatheart.” Marjorie’s face grew radiant. “The
very thing I’ll like best. I’d forgotten all about the judges. Their were
three of them at the other contest. It seems ages since that night,
doesn’t it?”
Leila nodded. “Happy ages,” she said, a soft light shining from her
bright blue eyes. “And you were not pleased with me that night,
Beauty, for putting you in your rightful place on the campus.”
“No, I wasn’t,” Marjorie replied with smiling candor. “I recall that I
was almost angry with you. I thought you did it merely to nettle the
Sans. I thought you were very clever, but I wasn’t sure whether or
not I truly liked you.”
“Ah, but I have won dozens of golden opinions from you, Beauty,
since then. I will tell you something quite remarkable about myself. I
am never disliked by a person who likes me.” Leila made the
statement with due impressiveness.
“I’ll tell you something else. You’re an affable old fake, and I’ve been
here just one-half hour longer than I intended to be.” Marjorie rose
from the chair she had been occupying in Leila’s and Vera’s room. “I
needed that half hour for a bout with a terrific bit of old French
poetry. Now it’s gone—the hour, I mean. I wish the poetry was nil,
too! And I’ve not opened my book! It’s almost dinner time, and after
dinner we’re due at Silverton Hall to help Robin rehearse that house
play. You hadn’t forgotten about it, had you?”
“I never forget anything I happen to remember,” was the re-assuring
response.
“Then keep on remembering the Beauty contest,” begged Marjorie
laughing. “This is Monday. I wish you could arrange it for Friday
night. I’m so anxious for Miss Monroe to win it. It will strengthen her
position on the campus.” Her lovely face grew suddenly serious. “You
know so well the way I feel about her, Leila. I’d love to have her free
herself from Leslie Cairns’ influence; to help her raise up a pride in
herself that will place her above doing the contemptible things the
Sans used to do.”
As she talked Marjorie’s voice took on a wistful earnestness which
Leila found irresistible. She did not share Marjorie’s views concerning
Doris Monroe. Nevertheless, Marjorie’s appeal to Leila for help in the
difficult conquest of the more difficult sophomore was in itself
sufficient cause for co-operation on Leila’s part.
“Watch the bulletin board tomorrow, and have no fears,” was Leila’s
parting advice as Marjorie reached the door. “We shall meet again,”
she added portentously.
“In about ten minutes; at dinner. And in my room, after dinner; and
after that, on the campus; and still after that, at Silverton Hall,” flung
back Marjorie over a shoulder as she went out the door. She ran
lightly down the hall to her room, inspirited by Leila’s promise. She
swung open the door with a gay little fling and entered to find Jerry
deep in the perusal of a letter.
“I’m going to be one of the judges at the Beauty contest,” she
breezily informed Jerry. “I forgot to ask Leila who she’d picked for
the other two judges.”
“It’s a good thing for the Ice Queen that you are going to wear a
disguise; efface your face from the college map for the time being,”
Jerry commented, eyes still on her letter. “No judge rig-out for
Jeremiah, I shall appear in all my fatal beauty. But I don’t expect to
get a fair deal,” Jerry sighed loudly. “When is the momentous Beauty
gathering to grace the gym?”
“Friday evening at eight.” Marjorie went on to recount hers and
Leila’s recent conversation.
“You old politician. You’ve everything fixed for your candidate,” Jerry
humorously accused. “What has become of the traditions of
Hamilton? Shocking!”
“They’re right in the foreground, AS ALWAYS,” retorted Marjorie. “I’m
neither old, nor a politician. Nothing has been fixed for my
candidate. Yes; I’ll admit I have one,” she declared in answer to
Jerry’s comically questioning glance. “Just the same, she can only
succeed on her own merits. Giving her a chance to do that isn’t
pulling strings for her.”
“I get you, Bean. I humbly apologize for any dark suspicions I may
have entertained against you. You are a Bean of rare pulchritude,
enterprise and integrity. You are not the only enterprising person on
the campus, though. I hate to speak of myself, but—er-her-r, ahem!”
Jerry loudly cleared her throat. “I’m a credit to the noble profession
of the sleuth.” Her tone of raillery held an undernote of triumph. Her
round face wore a victorious expression which Marjorie did not miss.
“What is it, Jeremiah? You’re brim full of something interesting. I
know you’re aching to tell me. Do go ahead.”
“It’s about those two letters,” Jerry began abruptly. “I mean the two
that were sent to you in the fall when the sophs were warring
among themselves, and Gentleman Gus drew the class presidency.”
“I haven’t forgotten them,” Marjorie said dryly. “You said you’d find
out all about them. Have you?” She gazed interestedly at Jerry.
“Now I begin to understand why you were praising yourself,” she
tacked on, with a teasing smile. “You’ll have just time to tell me
before the dinner gong sounds. Go to it.” She dropped easily down
upon her couch bed, eyes still intent on Jerry.
“You know, and so do I, that the sports committee letter was a fake.
We decided that first thing. Well, I’ve not discovered who wrote it.
I’m still suspicious of three different sets of girls on the campus. But
I haven’t a shred of proof against any of them. Being an honorable
sleuth I don’t prowl ignobly about the campus after my quarry. I set
legitimate traps for ’em. I deduce in a scientific and marvelous
manner. My methods are above reproach, but they take time.”
“So do your remarks,” Marjorie impolitely reminded. “The gong’s
going to ring very, very soon.”
“Oh, is it? So glad you told me. My, but you are rude at times. This is
one of ’em. Back to my subject. I never believed that Miss Walker
wrote the letter to you signed with her name. I made up my mind to
find out whether the handwriting was hers, but I failed to capture a
specimen of her penmanship. I tried a half a dozen nice, lady-like
little schemes. Not one worked. One day luck was with Jeremiah. I
picked up a fine and fussy handkerchief, monogrammed, L.M.W.”
With one eye on the clock Jerry hurriedly recounted the writing of
the note to Louise Walker and the subsequent mailing of it and the
handkerchief to the sophomore.
“Here’s the answer. Found it in the bulletin board this P. M. Look at
it. Next cast your eyes over this piece of bunk.” Jerry laid two
unfolded letters on the study table for Marjorie to examine.
Marjorie obediently left the couch where she had cosily disposed her
slim length. She reached Jerry’s side with one lithe bounce. Hastily
she picked up the letter Jerry indicated. Then she read:
“Dear Miss Macy:
“How fortunate for me that you should have found my pet
handkerchief! I bought it in Europe last summer of one of
those wonderful Belgian lace makers. I prize it highly on
account of the beauty of the embroidery. Consequently I
rarely carry it. Broke my rule for once and lost it. I had no
idea where. It is my good luck, and quite remarkable, I
think, that you should have guessed the initials on it to be
mine. Thank you for your courtesy. Assuring you of my
appreciation,
“Yours very sincerely,
“Louise May Walker.”

As she finished reading Miss Walker’s impersonally friendly note of


thanks Marjorie s eyes immediately sought the other letter. It was
the hateful letter she had received directly after the sophomore
election from Miss Walker. She had read if enough times to know it
by heart.
“Why, Jerry!” she cried, letting the two letters flutter from her hand
to the table. “She—Miss Walker—never wrote that miserably mean
letter to me! It’s not written in the same hand as the note she wrote
you about the handkerchief. We feel quite positive she wrote that
note. So she couldn’t have written the other.”
“Of course she didn’t write it,” Jerry asserted. “I’ve been keeping an
explorative P. G. eye on her since the basket ball season began. She
has some fine traits, Marjorie.” Jerry nodded her head in sober
confirmation of her opinion.
“I’m glad she didn’t write this.” Marjorie touched the condemnatory
letter with the tip of a finger. She picked up both letters again and
proceeded to a critical examination of the handwriting of each.
“I couldn’t be sure she had not until I had seen her handwriting. I
hadn’t the least excuse for writing her, and I didn’t care to ask the
girls to do it. I’d begun to harbor dark thoughts of waylaying her on
the campus in the misty twilight and appropriating her note-book.
She had a twice-a-week late trig period at Hamilton Hall. Then I
found the handkerchief in the main corridor. Maybe Jeremiah wasn’t
pleased with herself!” Jerry gave an elated little spin around on one
heel. “I wrote her and enclosed the hankey, and this is the reward of
honesty plus great forethought.” Jerry significantly tapped her
forehead.
“I’m glad,” Marjorie said again; “glad you are a great detective,
Jeremiah.” She smiled indulgently at Jerry. “But gladder still that Miss
Walker never wrote that spiteful letter. I’m gladdest of all that it is
more despicable even than if it were anonymous. It’s a forgery. A
person so unprincipled as to commit such a forgery is too
unprincipled to be dangerous.”
“Pearls of truth and wisdom, Bean. I get you, and agree with you,”
Jerry returned the smile. “I hate to say it, but I know only one
person who could qualify under that head—Leslie Hob-goblin Cairns.”
CHAPTER XXIV.

HELPING THE GOOD WORK ALONG

The warning, brazen voice of the dinner gong, which Miss Remson
rang but once before each meal, broke in upon Jerry’s pertinent
surmise. It was a signal which called for postponing further
conjecture in the matter.
“I’ve thought of Leslie Cairns more than once, Jerry, in connection
with both those letters,” Marjorie confessed as Jerry took the letters
Marjorie had carefully examined, folded them and tucked them into
a small leather portfolio. “Perhaps it’s been unfair in me to judge her
by past performances.”
“How could one help it? Come along, self-accusing Bean. I’m hungry
enough to eat all the dinner on our table, and give the rest of you
not a scrap. We’ll continue our amazing careers as private
investigators tonight after the ten-thirty bell is heard in the land and
a grateful hush has settled down on Room 15.”
During the busy, merry evening spent with Robin, Phil and the cast
of Silverton Hall payers, Marjorie had neither inclination nor
opportunity to consider the guilt or non-guilt of Leslie Cairns. As
stage manager Leila Harper combined more than usual efficiency
with a drollness of speech and manner which kept the amateur
thespians in a constant gale of giggles.
“Remember your cues and lines, or you’ll be walking into the middle
scenes where you’re neither expected nor wanted,” she warned her
flock.
The play, a two-act comedy entitled “The House Party,” was a bright,
snappy little production written by Eileen Potter, a promising
Silverton Hall sophomore. Phil had advocated the first production of
it as a house play. The sophomore class would be the guests of the
Silverton Hall sophs on the eventful evening. The living room was to
be turned into a theatre. Phil had enlisted Robin’s, Marjorie’s and
Leila’s services in rehearsing it.
Her plan, into which Robin, Marjorie and Leila gladly entered, had a
triple motive. She was anxious that Eileen’s talent should be
recognized on the campus. She was determined that the
unharmonious sophomore class should be brought into harmony.
She intended to hammer away at this plan until she accomplished
that harmony. Last of all, she liked giving house plays. Phil had a
soul even more bent on democracy than was that of Marjorie, if such
a condition could be. Robin often said to her: “Truly, Phil, if you had
lived in the days of ’76 you would have managed somehow to annex
your name to the Declaration of Independence.”
After the rehearsal the hard-working actors, managers and
prompters were treated to frozen custard and sponge cake by
Barbara Severn. She declared Leila to be a slave-driver and that the
custard and cake were needed by the cast as nourishment.
“If I am a slave-driver, why is it you are offering me custard and
cake?” Leila demanded, as Barbara presented her with a plate of the
frozen sweet.
“Merely because you have worked harder than your slaves. You are
what I should call a unique slave-driver,” Barbara sweetly explained.
“And you have far more good sense than you sometimes appear to
have,” Leila complimented. Whereupon the two beamed at each
other and shook hands.
“Don’t fail to be here for another rehearsal Thursday night and the
dress rehearsal on Saturday night,” were Leila’s parting words to the
cast, delivered in the middle of the front walk to the actor group
who had followed her out on the veranda.
She started across the campus in the pale winter moonlight with
Marjorie and Jerry, grumbling in pretended displeasure at the
amount of things she had to do during the next few days.
“Don’t say a word!” Marjorie exclaimed. “Two more rehearsals this
week, the Beauty contest on Friday night, Muriel’s birthday’s next
Monday. Saturday afternoon we have to go into town to buy
presents. Monday afternoon we’ll have to go over to Baretti’s to trim
the birthday table. Sunday I have to write letters, study and do a
dozen and one small things. I can say now I have nothing special on
hand after Monday, but long before then I’ll have a new lot of stunts
planned for the rest of next week.” Her tone grew more despairing
with each enumeration.
“You have so much trouble, Beauty, I’ll say nothing of my own,” was
Leila’s commiserating return, delivered with an unsympathetic grin.
“I am like an Irish fish out of water without Midget. That much I will
say.” Vera had gone to New York for a few days’ visit with her father
before he sailed on an all-winter cruise on the Mediterranean.
“I never saw an Irish fish. How does an Irish fish look?” Jerry
critically demanded.
“Like me. Did you not just hear me say it?” Leila retorted.
“I must go to the Arms to see Miss Susanna this week,” Marjorie
observed irrelevantly. No one appeared to be interested in her
announcement. Jerry and Leila were conducting a laughing
argument which had to do with Irish and non-Irish fishes.
“I love to talk to myself,” she made plaintive complaint when Jerry
and Leila finally paused for breath.
“And I had far rather talk to you, Beauty, than to some P. G.’s I
know,” Leila assured with deep meaning.
“You may talk to me, Bean,” Jerry graciously permitted. “I am
appreciative.”
During the remainder of the short hike across the campus Marjorie
became the laughing, but unimpressed, recipient of flattering
attention.
“Jerry,” she burst out abruptly, soon after the two girls were in their
own room, “it isn’t enough for us to say to each other that we are
glad Miss Walker didn’t write that letter. It is not fair to her not to tell
her the whole thing. Do you think it is?”
Jerry cocked her head to one side and considered. “Nope,” she
answered after due deliberation. “I suppose she ought to be
informed that she is not the villain we took her to be. It may take
marvelous managing by Marvelous Manager to tell her the awful
truth without rousing her ire. According to Gentleman Gus she is
anything but a lamb-like person when she isn’t pleased.”
“Would you be willing to go with me to see her?” Marjorie asked, her
brown eyes meditatively fixed on Jerry. “You are as——”
“Deep in the mud as you are in the mire,” supplied Jerry humorously.
“Something like that,” Marjorie agreed with a smile. “The letter was
sent to me in the first place, but the credit of the discovery that Miss
Walker didn’t write it belongs to you.”
“I’m not likely to pick any bouquets in such a briar patch,” shrugged
Jerry. “Don’t want em. More likely she’ll get wrathful at us when she
finds, we have kept the forged letter so long without going to her
and having matters out. But Jeremiah is not afraid. Let us hope she
behaves like the letter she really wrote.”
In the act of removing one of her slippers, Jerry took it by the strap.
Waving it jauntily she launched into a Bean jingle.
“Upon the haughty soph we’ll call
To clear her tarnished name;
For we have seen, O, noble Bean,
That she was not to blame.”

“That was an inspired jingle, Jeremiah,” Marjorie approved, her face


singularly sunny. “Miss Walker is not to blame. Since we know she
isn’t, we should be, if we didn’t hurry to tell her so.”
CHAPTER XXV.

“NEARER TO THE HEART’S DESIRE.”

Due to the numerous details Marjorie had on hand, on Saturday


afternoon, Marjorie and Jerry still found themselves facing the call
upon Miss Walker. They deplored the fact to each other as they
made ready to go to town with Leila, Ronny, Lucy and Katherine
Langly to shop for Muriel’s approaching birthday. Muriel had been
left out of the shopping party. As a consequence she had made dire
threats to disappear on her birthday and “spoil everything.” Jerry
declared that no one was foolish enough to believe she would.
“I never realized how much work you put into that first Beauty
contest, Leila Greatheart, until I saw the working out of this last
one,” Marjorie confided to Leila on the way to town that afternoon.
She was occupying her usual place beside Leila on the front seat. “I
felt so differently about the one last night. I had a chance to hide
away. I was so glad not to be in it, and on parade. It was darling in
you to give me the judges’ last speech in the contest. And didn’t my
fairy-tale princess look beautiful when she came forward to receive
the guerdon? Those wonderful long-stemmed pink roses went so
well with that crystal-beaded white frock she wore.”
“It was a dream of a dress,” Leila nodded. “At last we have a new
Beauty on the campus. Only I am glad I was not one of the judges. I
should never have displaced you for her. She is still too much the Ice
Queen to be to my taste.”
“You are the loyalest of loyal old dears,” Marjorie’s hand came to rest
for a moment on Leila’s shoulder. “I know you went strictly against
your inclinations; just to please me. Someday you’ll see that there
was method in my madness. The enchantment will be broken and
the freed princess will yet prove herself a credit to Hamilton.”
“I doubt if I shall be here to see it,” Leila made skeptical reply. “You
are feeling most optimistic because you have succeeded in wishing
your beauty reputation onto someone else.”
Marjorie merely smiled. “I’m a venerable P. G. now. I’m beyond such
vain frivolousness.”
“I see no signs of it,” Leila told her discouragingly. “I am sorry now
that I hid you on the judges’ stand.”
“Too late,” Marjorie’s merry little laugh rippled out. Her mood was
decidedly optimistic as a result of the successful way in which clever
Leila had carried on the Beauty contest.
As the president of the sophs, Augusta Forbes had signed the notice
of the coming contest which Leila had first posted on the main
bulletin board. This fact had appeared to point to the sophs as the
promoters of the Beauty contest. Privately directed by Leila, Gussie
had next called a class meeting for the express purpose of arousing
sophomore interest and had tactfully suggested that the contest
should be held under sophomore auspices.
While the sophs were still divided into two factions, as a result of the
fall elections, basket ball had done something to mitigate their wrath
against one another. It seemed the irony of fate that Louise Walker
and Augusta Forbes, rival centers and unfriendly classmates, should
have each admired the other’s basket ball prowess. Such, however,
was the situation between them. More, they were hovering on the
verge of friendly acquaintance.
This marvel Marjorie had already faintly divined by a curious mental
process of deduction which had developed within as a result of long-
patient working and waiting. She also saw signs which pointed to a
re-united sophomore class in the not far distant future. Her
conviction was borne out in this respect by the eager good-will with
which the sophs boosted the Beauty walk beforehand and
confidently paraded themselves around the gym for the judges’
inspection on the fateful night.
The girls of the other three classes were no less anxious to take part
in it. Even the dormitory girls made an extra trip from town so as to
be in the fun. Of the old Travelers only Ronny and Muriel competed.
Vera had not yet returned to Hamilton. As manager Leila had a good
excuse for staying out of it. Jerry demanded also to be a judge. She
gave Leila such a strenuous sample of the strength and volume of
her tones that Leila promptly accepted her. The senior class
furnished the third judge; a stentorian-voiced senior who often acted
as referee at basket ball games, and had developed amazing lung
power as a result.
While the Forbes faction of the sophs was supposedly hostile of
attitude toward Doris Monroe, its members had agreed among
themselves that, as a possible winner of the Beauty contest, she was
“the sophs’ best bet.” In consequence they suddenly began
exhibiting toward her a new friendliness which warmed with the
near approach of the contest. This put Doris on her mettle as
nothing else could have done. She had been saving the crystal-
beaded frock for what she might deem a really great occasion. She
now felt the occasion had arrived. Her one disturbing thought was
that Marjorie Dean would undoubtedly enter the contest. She
resolved that she must, yes, she would completely outshine her.
When the much-heralded contest was finally over and Doris stood
triumphant in front of the judges’ stand, the light gleaming on her
wavy golden hair, her strange green eyes dark with excitement, her
white, graceful arms laden with the long-stemmed pink roses, she
might have been posing as lovely summer in her early rose-decked
beauty. The faint, fascinating smile that came and went on her red
lips gave no clue to what was going on in her mind. Her slow,
occasional careless glances about the gymnasium were motivated by
the distinct secret purpose of locating Marjorie. Nor did she learn

You might also like