100% found this document useful (3 votes)
975 views

(Ebook) Reactive Programming with JavaScript by kan - The ebook is available for instant download, read anywhere

The document promotes instant access to various eBooks on reactive programming and JavaScript available at ebooknice.com. It includes links to multiple titles, such as 'Reactive Programming with JavaScript' and 'JavaScript Cookbook', along with details about the authors and content covered in the books. Additionally, it provides information about the author's background and the structure of the book, including chapters on core JavaScript and functional reactive programming.

Uploaded by

alkamayolsal
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 (3 votes)
975 views

(Ebook) Reactive Programming with JavaScript by kan - The ebook is available for instant download, read anywhere

The document promotes instant access to various eBooks on reactive programming and JavaScript available at ebooknice.com. It includes links to multiple titles, such as 'Reactive Programming with JavaScript' and 'JavaScript Cookbook', along with details about the authors and content covered in the books. Additionally, it provides information about the author's background and the structure of the book, including chapters on core JavaScript and functional reactive programming.

Uploaded by

alkamayolsal
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/ 76

Instant Ebook Access, One Click Away – Begin at ebooknice.

com

(Ebook) Reactive Programming with JavaScript by


kan

https://ebooknice.com/product/reactive-programming-with-
javascript-50194990

OR CLICK BUTTON

DOWLOAD EBOOK

Get Instant Ebook Downloads – Browse at https://ebooknice.com


Instant digital products (PDF, ePub, MOBI) ready for you
Download now and discover formats that fit your needs...

Start reading on any device today!

(Ebook) Reactive Programming with JavaScript by Hayward, Jonathan ISBN


9781783558551, 1783558555

https://ebooknice.com/product/reactive-programming-with-javascript-55895106

ebooknice.com

(Ebook) Reactive Programming with RxJS: Untangle Your Asynchronous JavaScript Code
by Sergi Mansilla ISBN 9781680501292, 1680501291

https://ebooknice.com/product/reactive-programming-with-rxjs-untangle-your-
asynchronous-javascript-code-5436056

ebooknice.com

(Ebook) JavaScript Cookbook, 2nd Edition_ Programming the Web by kan

https://ebooknice.com/product/javascript-cookbook-2nd-edition-programming-the-
web-50195402

ebooknice.com

(Ebook) Reactive Programming with RxJS 5: Untangle your asynchronous Javascript code
by Sergi Mansilla ISBN 9781680502473, 1680502476

https://ebooknice.com/product/reactive-programming-with-rxjs-5-untangle-your-
asynchronous-javascript-code-11056580

ebooknice.com
(Ebook) learning javascript 3e by kan

https://ebooknice.com/product/learning-javascript-3e-50195302

ebooknice.com

(Ebook) Reactive Programming with Angular and ngrx: Learn to Harness the Power of
Reactive Programming with RxJS and ngrx Extensions by Oren Farhi (auth.) ISBN
9781484226193, 9781484226209, 1484226194, 1484226208

https://ebooknice.com/product/reactive-programming-with-angular-and-ngrx-learn-
to-harness-the-power-of-reactive-programming-with-rxjs-and-ngrx-
extensions-5880848

ebooknice.com

(Ebook) Scala Reactive Programming: Build scalable, functional reactive


microservices with Akka, Play, and Lagom by Rambabu Posa ISBN 9781787288645,
1787288641, B073FR5T8F

https://ebooknice.com/product/scala-reactive-programming-build-scalable-
functional-reactive-microservices-with-akka-play-and-lagom-23390646

ebooknice.com

(Ebook) Learning Reactive Programming with Java 8 by Nickolay Tsvetinov ISBN


9781785288722, 1785288725

https://ebooknice.com/product/learning-reactive-programming-with-java-8-37720604

ebooknice.com

(Ebook) Learning Reactive Programming with Java 8 by Nickolay Tsvetinov ISBN


9781785288722, 1785288725

https://ebooknice.com/product/learning-reactive-programming-with-java-8-37699380

ebooknice.com
Reactive Programming with JavaScript
Table of Contents
Reactive Programming with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction and Installation
A 10,000-foot overview
An easier way to handle user interface programming
Programming paradigms
Installing the tools required
Installing Google Chrome
Installing Node.js
Installing the Starter Kit for ReactJS
Summary
2. Core JavaScript
The strict mode
Variables and assignment
Comments
Flow control
A note on values and NaN
Functions
Comments
Loops
Taking a look at ECMAScript 6
Summary
3. Reactive Programming – The Basic Theory
Declarative programming
The war on Heisenbugs
The Flux Architecture
From the pit of despair to the pit of success
Complete UI teardown and rebuild
JavaScript as a Domain-specific Language
The Big-Coffee Notation
Summary
4. Demonstrating Nonfunctional Reactive Programming – A Live Example
The history of a game with multiple ports
The HTML for the web page
Using a content distribution network wherever we can
Some simple styling
A fairly minimal page body
The JavaScript that animates that page
A brief syntax note – Immediately Invoked Function Expression
Variable declaration and initialization
The function used to start or restart the game
The function that creates game levels
Getting our hands dirty with ReactJS classes
Tick-tock, tick-tock – the game's clock ticks
GAME OVER
Summary
5. Learning Functional Programming – The Basics
Custom sort functions – the first example of functional JavaScript and first-
class functions
This leads us to array.filter()
Illusionism, map, reduce, and filter
Fool's gold – extending Array.prototype
Avoiding global pollution
The map, reduce, and filter toolbox – map
The reduce function
The last core tool – filter
An overview of information hiding in JavaScript
Information hiding with JavaScript closures
Summary
6. Functional Reactive Programming – The Basics
A trip down computer folklore's memory lane
Advanced prerequisites for Hello, World!
Distinguishing the features of functional reactive programming
If you learn just one thing...
Learn what you can!
JavaScript as the new bare metal
Summary
7. Not Reinventing the Wheel – Tools for Functional Reactive Programming
ClojureScript
Om
Bacon.js
Brython – a Python browser implementation
Immutable.js – permanent protection from change
Jest – BDD unit testing from Facebook
Implementing the Flux Architecture using Fluxxor
Summary
8. Demonstrating Functional Reactive Programming in JavaScript – A Live
Example, Part I
What we will be attempting in this chapter
This project's first complete component
The render() method
Triggering the actual display for what we have created
Summary
9. Demonstrating Functional Reactive Programming in JavaScript with a Live
Example Part II – A To-do List
Adding a to-do list to our application
Including ReactJS add-ons in our project
Setting the appropriate initial state
Making text editable
Heavy lifting with render()
Inner functions used to render
Building the result table
Rendering our result
Differentiating columns visually
Summary
10. Demonstrating Functional Reactive Programming in JavaScript: A Live
Example Part III – A Calendar
Play it again Sam – an interesting challenge
Classical Hijaxing works well
Built with usability in mind, but there's still room to grow
Plain old JavaScript objects are all you need
Progressive disclosure that starts simply
A render() method can easily delegate
Boring code is better than interesting code!
A simple UI for simply non-recurring entries...
The user can still opt-in for more
Avoiding being clever
Anonymous helper functions may lack pixie dust
How far in the future should we show?
Different stripes for different entry types
Now we're ready to display!
Let's be nice and sort each day in order
Let them use Markdown!
One thing at a time!
The holidays that inspired this calendar
Summary
11. Demonstrating Functional Reactive Programming in JavaScript with a Live
Example Part IV – Adding a Scratchpad and Putting It All Together
Adding a WYSIWYG scratchpad, courtesy CKeditor
Bringing all things together into one web page
This book is about ReactJS, so why use CKeditor?
CKeditor – small free offerings, and small is beautiful
Including CKeditor in our page
Integrating all four subcomponents into one page
Persistence
One detail – persisting the CKeditor state
Summary
12. How It All Fits Together
A review of the terrain covered
Could the Mythical Man-Month have been avoided?
ReactJS is just a view, but what a view!
Programming is fun again!
Summary
The next steps from here
A. A Node.js Kick start
Node.js and INTERCAL
Warning – Node.js and its ecosystem are hot, and hot enough to burn you
badly!
A sample project – a server for our Pragmatometer
Client-side preparations
The server side
Summary
Index
Reactive Programming with JavaScript
Reactive Programming with JavaScript
Copyright © 2015 Packt Publishing All rights reserved. No part of this book
may be reproduced, stored in a retrieval system, or transmitted in any form or by
any means, without the prior written permission of the publisher, except in the
case of brief quotations embedded in critical articles or reviews.

Every effort has been made in the preparation of this book to ensure the accuracy
of the information presented. However, the information contained in this book is
sold without warranty, either express or implied. Neither the author, nor Packt
Publishing, and its dealers and distributors will be held liable for any damages
caused or alleged to be caused directly or indirectly by this book.

Packt Publishing has endeavored to provide trademark information about all of


the companies and products mentioned in this book by the appropriate use of
capitals. However, Packt Publishing cannot guarantee the accuracy of this
information.

First published: August 2015

Production reference: 1260815

Published by Packt Publishing Ltd.

Livery Place

35 Livery Street

Birmingham B3 2PB, UK.

ISBN 978-1-78355-855-1

www.packtpub.com
Credits
Author

Jonathan Hayward

Reviewers

Antal Orcsik

Sven A Robbestad

Hibai Unzueta

Commissioning Editor

Kunal Parikh

Acquisition Editor

Manish Nainani

Content Development Editor

Aparna Mitra

Technical Editor

Mohita Vyas

Copy Editors

Vikrant Phadke

Alpha Singh

Ameesha Smith-Green

Project Coordinator

Mary Alex
Mary Alex

Proofreader

Safis Editing

Indexer

Rekha Nair

Graphics

Jason Monteiro

Production Coordinator

Aparna Bhagat

Cover Work

Aparna Bhagat
About the Author
Jonathan Hayward is a polymath with advanced degrees bridging mathematics,
computers (UIUC), theology, and philosophy. He obtained his theology and
philosophy degrees from Cambridge University. He has worked in many areas of
web development, with a site (http://cjsh.name/) for "after hours" titles, and he is
also interested in the human side of computing, including usability/UI/UX. His
most popular work is a piece of poetry at https://cjshayward.com/doxology/. The
faster route to get there is by typing cjsh.name/doxology, and it gets there.
Jonathan has studied many languages, including French, Spanish, Latin, and
Greek. He is currently learning Russian. He has worked on various other books
as well (refer to http://www.amazon.com/s/ref=nb_sb_noss_2?url=search-
alias%3Daps&field-keywords=%22CJS+Hayward%22 to find out more).

I would like to thank my parents, John and Linda; my brothers, Matthew, Joe,
and Kirk; my sisters-in-law, Kristin and Adrien; and my nephews, Jack and
James. I would also like to thank all of the Packt Publishing editorial team,
including a great many who I do not know, but I would like to single out Usha,
Akshay, Neetu, Mohita, and Aparna. They are the editors who left me wishing
we lived next door. Finally, I'd like to thank all those at Facebook for releasing
ReactJS as a framework that is free for the rest of the world.
About the Reviewers
Antal Orcsik is a full-stack web developer from Hungary. He works at Prezi
(https://prezi.com/) as a payment engineer. In the last decade, he worked for
Hungary's biggest real estate catalog site and one of the biggest local weather
portals. Then he joined the fantastic team that created a revolutionary
presentation tool called Prezi to change the way the world shares ideas. During
this time, he gained experience in Scala, Python, and PHP backend environments
as well as JavaScript frontend technologies, while experimenting with various
other fields of the full-stack web development spectrum. Antal is a big fan of
cats, games, science fiction, and hamburgers.

I would like to thank my lovely girlfriend for her support and patience while I
played my part in creating this book.

Sven A Robbestad is a Norwegian open source developer and frequent


conference speaker with more than 20 years of experience of working on the
Web. He is passionate about mobile development and is always ready to talk
about code. Sven is currently employed at TeliaSonera
(http://www.teliasonera.com/) as a technologist.

Hibai Unzueta is a multifaceted builder who was programming and designing


complex systems much before he applied for his first job.

He believes that technology is nothing without technique and technique in turn


needs a solid vision-based foundation. He enjoys territories where different
knowledge areas overlap. Lately, he has been involved in projects of data
visualization and user experience design.

For the past 2 years, he has been researching travel search paradigms and
technology with the intention of launching a new project that is expected to
rethink the way we do travel planning. As a result, he has worn many hats, but
never all of them at once.
www.PacktPub.com
Support files, eBooks, discount offers, and more
For support files and downloads related to your book, please visit
www.PacktPub.com.

Did you know that Packt offers eBook versions of every book published, with
PDF and ePub files available? You can upgrade to the eBook version at
www.PacktPub.com and as a print book customer, you are entitled to a discount
on the eBook copy. Get in touch with us at <service@packtpub.com> for more
details.

At www.PacktPub.com, you can also read a collection of free technical articles,


sign up for a range of free newsletters and receive exclusive discounts and offers
on Packt books and eBooks.

https://www2.packtpub.com/books/subscription/packtlib

Do you need instant solutions to your IT questions? PacktLib is Packt's online


digital book library. Here, you can search, access, and read Packt's entire library
of books.
Why subscribe?
Fully searchable across every book published by Packt
Copy and paste, print, and bookmark content
On demand and accessible via a web browser
Free access for Packt account holders
If you have an account with Packt at www.PacktPub.com, you can use this to
access PacktLib today and view 9 entirely free books. Simply use your login
credentials for immediate access.

To my nephews Jack and James: You are the light of my life


Preface
Charles Cézanne famously said about the impressionist painter Claude Monet,
"Monet is only an eye, but what an eye!" Today, we can similarly say, "ReactJS
[or if you prefer, "ReactJS is only a view, but what a view!"

ReactJS has neither the intention nor the ambition to be a complete, general-
purpose web framework. It doesn't even include tooling for Ajax calls! Rather,
the intent is that you will use technologies that make sense for different concerns
in your application, and use ReactJS's power tools for views and user interface
development.

Functional reactive programming has been an extremely high-hanging fruit, with


a prohibitive barrier to entry in terms of sheer mathematical expectations
assumed in order to work with it. No longer with ReactJS! A veteran C++
programmer with no particularly deep math background—I said this to pick a
profile of programmers who keep on saying on Stack Overflow that they don't
get functional reactive programming—is a veteran programmer who stands a fair
chance of getting real work done using ReactJS.

This book is about ReactJS, a simple and small technology that nonetheless lets
huge teams work together on different components of a web page without
stepping on each others' feet, but without a hint of bureaucratic measures. And
add some liberal help of pixie dust.
What this book covers
Chapter 1, Introduction and Installation, provides a 10,000-foot overview of
different programming paradigms, each of which has its strengths, and an
introduction to the trio of functional programming, reactive programming, and
functional reactive programming.

Chapter 2, Core JavaScript, covers some of JavaScript's better neighborhoods


and omits the minefields, with a debt to Douglas Crockford, if not a complete
agreement. In terms of the parts of JavaScript that you use, you should be doing
most of your work within this core.

Chapter 3, Reactive Programming – The Basic Theory, is a basic exploration of


reactive theory, or reactive programming, specifically in relation to Facebook's
ReactJS user interface framework.

Chapter 4, Demonstrating Nonfunctional Reactive Programming – A Live


Example, proves that not all development is from scratch. Most professional
work is not greenfield. This will offer a live example of retrofitting a simple
video game, the most recent implementation using jQuery, to take advantage of
ReactJS (if you are using ReactJS, you will probably be doing other conversions
from jQuery to ReactJS).

Chapter 5, Learning Functional Programming – The Basics, helps you if you


want to understand functional programming but have no idea where to start.
Here's one place to start! Map, reduce, and filter are introduced as an
inexhaustible bag of tricks.

Chapter 6, Functional Reactive Programming – The Basics, covers what has


been said about functional programming and reactive programming. It will be
put together with some sage advice, and the last bit of foundation will be laid for
the remaining hands-on work in this book.

Chapter 7, Not Reinventing the Wheel – Tools for Functional Reactive


Programming, contains a lot to cover in one book, let alone one chapter. But
there is meant to be an interesting sampling of a space where a lot of interesting
options are made available, including writing ReactJS code from a language
other than JavaScript.
Chapter 8, Demonstrating Functional Reactive Programming in JavaScript – A
Live Example, Part I, is where we see an application housing a whimsical
ReactJS component written in ReactJS from scratch, and showcasing the sweet
JSX syntactic sugar that is not required but is still made available for ReactJS
development.

Chapter 9, Demonstrating Functional Reactive Programming in JavaScript with


a Live Example Part II – A To-do List, leads us to our first real component,
designed to be used rather than just amuse. We implement a to-do list, and it has
several markers other than just "done" to indicate what state, priority, and other
things a task has.

Chapter 10, Demonstrating Functional Reactive Programming in JavaScript: A


Live Example Part III – A Calendar, is where we build a calendar. It is intended
to gracefully support not only one-time events but also many kinds of repeating
events with all kinds of rules that people offer.

Chapter 11, Demonstrating Functional Reactive Programming in JavaScript


with a Live Example Part IV – Adding a Scratchpad and Putting It All Together,
provides a rich-text scratchpad with CKeditor. This shows how we might
interoperate with other user interface tools. Then we wind up by bringing the
four components together into one combined page and adding persistence
functionality so that our user interface doesn't forget what it is told.

Chapter 12, How It All Fits Together, reviews what we covered in this book, and
we look at the next steps in a world to explore.

Appendix, A Node.js Kick start, looks at some of the good, the bad, and the ugly
of a "Wild, Wild West" technology that everybody seems to want in on.
What you need for this book
There is a bit of software to download, and you will need a web server that can
at least serve static content. Appendix, Node.js, covers building a web server for
the larger project in Node.js, but all the chapters can work with just a web server
that will serve static content in the most basic fashion. You'll need a desktop
computer, which can be almost anything that can run Node.js (if you choose to
work through the appendix). The text will work well enough with Unix, Linux,
Mac, Windows, Cygwin, and so on. If you want to run it from a mobile device,
that may be a praiseworthy approach, but please work from a device (desktop or
otherwise) using some standard server or desktop operating system.

However, all that you really need is a server or desktop, a browser such as
Chrome, a web server, and a willingness to dive into something new. Everything
else is provided in the text.
Who this book is for
This book is intended for programmers who want to dive into functional reactive
programming and Facebook's ReactJS. There is an expectation of some general
programming maturity, some knowledge of JavaScript, and some knowledge of
producing user interfaces. Familiarity with functional programming is also one
of the several things that would help, but the hope, whether realized or not, is to
create a book using which a veteran programmer in any general-purpose
language with some (perhaps light) knowledge of JavaScript and web
development would be able to get things to work.

People who do have a solid background in frontend web development and


JavaScript's functional core may be surprised how easy it is to work with
ReactJS, and may find it like slicing a hot knife through butter.
Conventions
In this book, you will find a number of text styles that distinguish between
different kinds of information. Here are some examples of these styles and an
explanation of their meaning.

Code words in text, database table names, folder names, filenames, file
extensions, pathnames, dummy URLs, user input, and Twitter handles are shown
as follows: "The typeof function returns a string containing a description of a
type; thus, typeof can offer an extended type."

A block of code is set as follows:


var counter = (function() {
var value = 0;
return {
get_value: function() {
return value;
},
increment_value: function() {
value += 1;
}
}
})();

Any command-line input or output is written as follows:


python -c "import binascii; print
binascii.hexlify(open('devrandom').read(1024))"

New terms and important words are shown in bold. Words that you see on the
screen, for example, in menus or dialog boxes, appear in the text like this:
"When the installer starts, click on Next, as follows:"
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.
Reader feedback
Feedback from our readers is always welcome. Let us know what you think
about this book—what you liked or disliked. Reader feedback is important for us
as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail <feedback@packtpub.com>, and


mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either
writing or contributing to a book, see our author guide at
www.packtpub.com/authors.
Customer support
Now that you are the proud owner of a Packt book, we have a number of things
to help you to get the most from your purchase.
Downloading the example code
You can download the example code files from your account at
http://www.packtpub.com for all the Packt Publishing books you have
purchased. If you purchased this book elsewhere, you can visit
http://www.packtpub.com/support and register to have the files emailed directly
to you.
Errata
Although we have taken every care to ensure the accuracy of our content,
mistakes do happen. If you find a mistake in one of our books—maybe a mistake
in the text or the code—we would be grateful if you could report this to us. By
doing so, you can save other readers from frustration and help us improve
subsequent versions of this book. If you find any errata, please report them by
visiting http://www.packtpub.com/submit-errata, selecting your book, clicking
on the Errata Submission Form link, and entering the details of your errata.
Once your errata are verified, your submission will be accepted and the errata
will be uploaded to our website or added to any list of existing errata under the
Errata section of that title.

To view the previously submitted errata, go to


https://www.packtpub.com/books/content/support and enter the name of the
book in the search field. The required information will appear under the Errata
section.
Piracy
Piracy of copyrighted material on the Internet is an ongoing problem across all
media. At Packt, we take the protection of our copyright and licenses very
seriously. If you come across any illegal copies of our works in any form on the
Internet, please provide us with the location address or website name
immediately so that we can pursue a remedy.

Please contact us at <copyright@packtpub.com> with a link to the suspected


pirated material.

We appreciate your help in protecting our authors and our ability to bring you
valuable content.
Questions
If you have a problem with any aspect of this book, you can contact us at
<questions@packtpub.com>, and we will do our best to address the problem.
Chapter 1. Introduction and Installation
Welcome to the wonderful world of reactive (functional) programming in
JavaScript! In this book, we will cover the good parts of JavaScript, although we
will not follow it religiously. We will cover functional programming, reactive
programming, and the ReactJS library and integrate all of these into functional
reactive programming with JavaScript. If you are going to study reactive
programming, it is our suggestion that you seriously consider functional reactive
programming, including learning functional programming as much you can. In
this context, the whole of functional reactive programming is more than the sum
of its parts. We will be applying reactive programming to JavaScript user
interface development. User interfaces are one domain in which functional
reactive programming (FRP), really shines.

The topics that will be covered in this chapter are as follows:


A 10,000-foot overview of the subject-matter, including:
A discussion of an easier approach to user interface programming
A brief discussion of programming paradigms, such as functional and
reactive programming
An overview of the chapters in this book
A look at how to install some of the tools used over the course of this book
A 10,000-foot overview
There are a lot of things that can be stated, but (functional) reactive
programming may be easier than you think. Today, much that has been written
about functional reactive programming is intimidating, much like the
instructions for closures a few years ago.
An easier way to handle user interface programming
Years ago, when I first began to study JavaScript, I picked one site and literally
took everything from it that I needed to understand to perform objected-oriented
information hiding, that is, how to create a JavaScript object that had private
fields. I read perhaps two or three chapters that were dense with theoretical
computer science and 10-15 percent of the introduction before giving up. Then I
saw how easy it was to use a closure to create an object with private fields on a
simple monkey see, monkey do basis:
var counter = (function() {
var value = 0;
return {
get_value: function() {
return value;
},
increment_value: function() {
value += 1;
}
}
})();

Right now, functional reactive programming is in the state in which JavaScript


closures were some years back. The amount of theory you have to read before
you can start reactive programming is astounding, and large portions of the
literature are of a PhD reading level. That's bad news. But the good news is that
you don't have to wade through so much reading.

The purpose of this book is to provide something comparable to the monkey see,
monkey do way of conveying how to use a closure to make a JavaScript object
with private fields. Theory, as such, is not bad, nor is it a problem to introduce
theory for a discussion, but making a full-fledged dissertation's theoretical
backing as the price to do something simple is a problem.

It is our hope that this book will let you understand why building, for instance, a
game UI in JavaScript is easier with functional reactive programming than with
jQuery.
Programming paradigms
There are multiple programming paradigms around, and not all are mutually
exclusive. Many programming languages are multiparadigm languages,
supporting the use of more than one paradigm, including not only JavaScript, but
also the likes of OCaml, PHP, Python, and Perl.

Note that you can at least sometimes use a paradigm with a language that is not
explicitly designed to support it. Object-oriented programming was originally
formulated not for languages such as Java or Ruby that are specifically intended
to support object-oriented programming, but as matter of an engineering
discipline originally used in languages that predate object-oriented
programming.

Among the programming paradigms, we now have the following:


Aspect-oriented programming: Some have suggested that the professional
development of a programmer moves from procedural programming to
object-oriented programming, then to aspect-oriented programming, and
finally to functional programming. A canonical example of an aspect-
oriented concern, for an aspect that is spread through the program in naïve
usage, is logging. Aspect-oriented programming deals with cross-cutting
aspects of programming, such as security, the diagnostic exposure of a
state, and logging.
Declarative programming: One of the key concepts of functional reactive
programming is that it is declarative rather than imperative. In other words,
c = a + b does not mean take the present value of a, add the present value
of b, and store their sum in c. Instead, we declare a lasting relationship that
works a bit like C1 = A1 + B1 in a spreadsheet. If A1 or B1 changes, C1 is
immediately affected by the change. What is stored in C1 is not the value of
A1 plus the value of B1 at the time of assignment, but something more
lasting from which individual values may be obtained in a print on demand
fashion.
Defensive programming: Analogous to defensive driving, defensive
coding means writing code that behaves correctly when it is given
something defective. Functional reactive programming is, among other
things, an approach to either functioning correctly or degrading gracefully
in the face of network issues and nonideal, real-world conditions.
Functional programming: Here, the term function has its mathematical
rather than programming meaning. In imperative programming, functions
can (and most often, they do) manipulate states. Hence, an init() function
might initialize all of the data that a program initially needs to run initially.
A function is something that takes zero or more inputs and returns a result.
For example, f(x) = 3x+1, g(x) = sin(x), and h(x, y) = x'(y) (the derivative
of x at y) are all mathematical functions; none of them command any
manipulation of stateful data. A pure function is a function under a
mathematical definition that excludes telling how to deal with states.
Functional programming also allows and often includes, with the last
derivative-based example, higher order functions, or functions that act on
functions (in calculus, a derivative or an integral represents a higher order
function, and iterative integration includes a higher order function that takes
another higher order function as the input). Problems whose solutions
center on abstract functions that operate on abstract functions tend to be
more appealing to computer science types than something really used in the
business world. The higher order functions explored here will be relatively
concrete. You need not use higher order functions all the time, and once
you've grasped the core concepts, they are not hard to use.
Imperative programming: Imperative programming is a common way of
programming, and for the majority of programmers who are first taught
imperative programming, it may seem the most natural way to work.
Functional reactive programming's marketing proposal includes a live
alternative to this basic approach. An alternative to the natural-seeming
tendency towards imperative programming is found in functional reactive
programming's declarative programming, pure functions (including higher
order functions) in functional programming, and the time series of reactive
programming.
Information hiding: Steve McConnel's Code Complete describes several
methodologies, and tells us which are optimal for different settings (the
sweet spot for procedural programming is on smaller projects than on
object-oriented programming, for instance). For information hiding alone,
his recommendation was use this as much as possible. In generic
information hiding developments, a large project is approached by walling
off secrets within the larger area, and larger secrets are divided by walling
off subsecrets. A large portion of procedural programming, object-oriented
programming, and functional programming alike is intended to facilitate
information hiding. Information hiding is the software engineering concern
behind the Law of Demeter, for example, you may have up to one dot in a
method call (foo.bar()), but not two (foo.baz.bar()).
Object-oriented programming: Instead of having a monolithic
architecture, a program is segmented into objects. These objects have their
own methods and fields and may in turn be segmented into further objects.
This offers an acceptable level of information hiding for larger projects than
procedural programming, even if object-oriented programming more or less
starts with procedural programming and builds on top of it.
Patterns: Patterns are not a recipe for good software, but at a higher level
of human abstraction, they provide a way of talking about the best recurring
solutions so as to avoid reinventing from scratch what has already been
solved. Also, specific patterns are taken into the limelight, including MVC
and now the Observer pattern, which is often not mentioned in relation to
reactive programming despite being a founding ingredient.
Procedural programming: Procedural programming is one of the oldest of
the methodologies mentioned, and it was meant to provide some order to
the spaghetti code fostered by the even older goto-based flow control.
Perhaps we can criticize procedural programming for not doing enough
once object-oriented programming, aspect-oriented programming, and
object-oriented design patterns are available. It is the right thing to move on
from procedural programming when you have tools to push further than
procedural programming from a rat's nest of gotos, the pointer as the goto
of data structures, and so on.
Reactive programming: Suppose functional programming is, in large
measure, programming where functions have first-class status and it is
possible to make higher order functions (functions that act on other
functions as input). Then reactive programming is, in large measure,
programming where time series (functions that have different values over
time) have first-class status. For music, games, user interfaces, and some
other use cases, calculating the right value for the present moment is an area
where reactive programming shines.
Functional reactive programming: Functional reactive programming is
reactive programming built on functional building blocks, and in which
both functions and time series are first-class entities. There are some useful,
and surprisingly simple, functions that act on one time series to provide
another time series from it (either of these series can be acted on by other
functions on time series). One of the major selling points of functional
reactive programming is that it provides a more graceful and much more
maintainable approach than following your nose straight into the callback
hell.
Installing the tools required
Many readers will be comfortable enough with simply installing Chrome and
Node.js, if they were not already installed some time ago. For those who would
prefer step-by-step directions, here are the details of installing the appropriate
software.

Google Chrome can be installed from http://google.com/chrome. Note that for


some Linux distributions, Chrome may or may not be available from your
package manager. Google Chrome is an obvious choice to think of for
something to include in a distribution's packages, but licensing concerns may list
Chrome as non-free due to some of its parts, meaning that as far as the
distribution maintainers are concerned, you may be welcome to use this, but
we're not comfortable including it in a free-only package repository.

Node.js is available from http://nodejs.org/download. If you are running Linux,


it is probably better to obtain it through your package manager. Note that
Node.js comes with its own package manager, npm, which can be used to
download packages that can be used under Node.js.

The useful Starter Kit for ReactJS is available from


http://facebook.github.io/react/downloads.html.

The following instructions are given for Windows 8.1 (I prefers to develop in
Mac or Linux, but is writing for Windows 8.1 as a common lingua franca).
Installing Google Chrome
We will be using Google Chrome as the primary reference browser:
1. To download it, go to http://google.com/chrome, and click on the
Download now button to the left, towards the bottom, as shown here:

2. Next, click on the Accept and Install button down and to the right, as
shown in the following screenshot:
3. After that, click on the Run button when asked whether you want to run or
save the installer, as shown here:

4. Next, authorize Chrome's installer to make changes to the system, as shown


in the following screenshot:
5. Then click on the Next button to install Chrome, as shown in the following
screenshot:
6. Wait a minute for it to install and then if you are willing, set Chrome as
your default browser:
And that's it!
Installing Node.js
Installing Node.js is straightforward and it makes it easy to start serving HTTP
using JavaScript as the only language.
1. Go to http://nodejs.org/download:

2. Click on the Windows Installer and wait for the installer to download.
Then click on the bottom-left part of the window, as shown in this
screenshot:
3. When the installer starts, click on Next, as follows:
4. Then click on the checkbox to accept the terms of the agreement, as shown
here:
5. After that, click on the Next button to continue, as shown in the following
screenshot:
6. When asked where to install the software, click on the Next button, as
shown in this screenshot:
Other documents randomly have
different content
Yhä haaveilevana ja hajamielisenä luuli Manicamp de Guichesta
puhuttavan ja vastasi:

"Kiitos, kreivi jaksaa vähän paremmin."

Ja hän jatkoi kulkuansa eteishuoneeseen asti, missä tapasi


d'Artagnanin. Tältä hän pyysi selitystä, kun kuninkaan sävy oli hänen
nähdäkseen tuntunut jotenkuten hätääntyneeltä. Muskettisoturi
vakuutti, että hän oli erehtynyt; kuningas muka päinvastoin oli
huiman hilpeällä päällä.

Kello löi kahdeksan. Tällä tunnilla Ludvig tavanmukaisesti nautti


aamiaisensa; hovisääntö määräsi, että kuninkaalla piti aina olla nälkä
kello kahdeksalta. Hän antoi kattaa pienen pöydän
makuuhuoneeseensa ja söi nopeasti. De Saint-Aignan, josta hän ei
tahtonut erota, huolehti tarjoilusta. Sitten kuningas antoi muutamia
sotilaallisia vastaanottoja, jollaikaa de Saint-Aignanin tehtävänä oli
liikkua tiedustelemassa. Kaiken aikaa ollen puuhassa, yhäti
huolissaan, herkeämättömästi odotellen de Saint-Aignania, joka oli
lähettänyt kaiken väkensä etsimään ja lähtenyt itsekin, kuningas
siirtyi työhuoneeseensa kello yhdeksän. Lähettiläätkin astuivat sisälle
ensimmäisten lyöntien kaikuessa, ja kun viimeinen lyönti kumahti,
ilmestyivät kuningatar ja Madame.

Lähettiläitä oli kolme Hollantia ja kaksi Espanjaa edustamassa.


Kuningas loi heihin silmäyksen ja tervehti. Samassa astui sisälle
myöskin de Saint-Aignan. Hänen saapumisensa oli kuninkaalle paljon
tärkeämpi kuin lähettiläiden, olipa heitä kuinka monta tahansa ja
tulivatpa he mistä maasta hyvänsä. Ennen kaikkea antoikin kuningas
de Saint-Aignanille kysymysmerkin, johon tämä vastasi varman
kieltävästi.
Kuningas oli menettää kaiken miehuutensa; mutta kun
kuningatarten, neuvosherrain ja lähettiläiden katseet olivat
kohdistuneet häneen, teki hän voimakkaan ponnistuksen ja kehoitti
viimemainittuja esittämään sanottavansa.

Silloin toinen Espanjan edustajista piti pitkän puheen, jossa kehui


Espanjan liiton tuottamia etuja.

Kuningas keskeytti hänet lausumalla:

"Monsieur, toivoakseni sen, mikä on hyvä Ranskalle, täytyy


myöskin olla varsin edullista Espanjalle."

Nämä sanat ja varsinkin se käskevä sävy, jolla ne lausuttiin, sai


lähettilään kalpenemaan ja molemmat kuningattaret punastumaan,
nämä kun espanjattarina tunsivat vastauksen loukkaavan suku- ja
kansallisylpeyttään.

Hollannin lähettiläs ryhtyi vuorostaan puhumaan, valitellen


kuninkaan osoittamaa ennakkoluuloisuutta hänen maatansa kohtaan.

Kuningas keskeytti hänetkin.

"Monsieur", virkkoi hän, "on omituista, että te tulette esittämään


valituksianne, vaikka päinvastoin minulla olisi siihen syytä, ja enhän
minäkään valita."

"Teilläkö, sire, syytä valitukseen", kysyi hollantilainen, "ja mistä


pahasta?"

Kuningas hymyili katkerasti.


"Moititteko minua, monsieur", sanoi hän, "ehkä
ennakkoluuloisuudesta hallitusta vastaan silloinkin, kun se hyväksyy
ja suojelee julkisia herjaajia?"

"Sire!…"

"Sanon teille", jatkoi kuningas, kiihkoutuen omista kiusoistaan


paljon enemmän kuin valtiollisesta kysymyksestä, "sanon teille, että
Hollanti tarjoo turvapaikan kaikille, jotka minua vihaavat, ja varsinkin
kaikille herjaajilleni."

"Oi, sire!…"

"Ah, te kaipaatte todistuksia? No, niitä on helppo saada. Mistä


ovat kotoisin häväistyslehtiset, jotka esittävät minut maineettomana
ja mahdittomana hallitsijana? Teikäläiset kirjapainot niitä syytävät.
Jos minulla olisi kirjurini täällä, voisin teille luetella tuotteiden ja
painattajain nimet."

"Sire", vastasi lähettiläs, "herjauskirjoitus ei voi olla kansan työ.


Onko kohtuullista, että sellainen mahtava kuningas kuin teidän
majesteettinne tekee kokonaisen kansan vastuunalaiseksi
joidenkuiden nälkäisten houkkioiden sepustuksista?"

"Olkoonpa niin, voin myöntää teidän olevan oikeassa. Mutta kun


Amsterdamin rahapajassa lyötetään minua häpäiseviä mitaleja, niin
onko sekin muutamien retkujen hullutusta?"

"Mitaleja?" sopersi lähettiläs.

"Mitaleja, niin", toisti kuningas katsahtaen Colbertiin.


"Olisi tarpeellista", yritti hollantilainen, "että teidän majesteettinne
voisi olla ihan varma…"

Kuningas katseli yhä Colbertia, mutta tämä ei ollut


ymmärtävinään, vaan pysyi äänettömänä kuninkaan silmäniskuista
huolimatta.

Silloin d'Artagnan lähestyi ja ottaen taskustaan muistorahan laski


sen kuninkaan käteen.

"Tässä on teidän majesteettinne etsimä mitali", sanoi hän.

Kuningas otti rahan, ja silloin hän saattoi nähdä silmillään, jotka


siitä asti kun hän oli todella päässyt valtaan olivat vain leijailleet
yläilmoissa, — silloin, sanoimme, hän saattoi nähdä Hollantia
esittävän julkean olennon, joka Josuan tavoin seisahdutti auringon.
Rahaan oli kehäkirjoitukseksi piirretty In conspectu meo stetit sol.

"Minun edessäni pysähtyi aurinko!" käänsi kuningas


raivostuneena. "Haa, ette kai enää kiellä?"

"Ja aurinko on tuo", virkkoi d'Artagnan, viitaten työhuoneen


kaikissa seinäverhoissa moninaisena säteilevään vertauskuvaan, joka
kaikkialle levitti ylvästä tunnuslausettaan: Nec pluribus impar.[10]

Ludvigin kiukustus, jota hänen yksityisen mielenkarvautensa


vihjaukset yhä enemmän kiihoittivat, ei tarvinnut enää tätä yllykettä
hänen vimmastuakseen ihan suunniltaan. Hänen silmänsä säihkyivät
puhkeamaisillaan olevan kiihkeän riidan halusta.

Colbertin ponteva katse vielä kahlitsi myrskyn. Lähettiläs yritti


puolusteluja. Hän sanoi, että kansojen turhamaisuudella ei ollut
mitään merkitystä; että Hollanti oli ylpeä voituaan niin pienillä
apulähteillä kannatella arvoansa suurena kansana ja mahtaviakin
kuninkaita vastaan, ja että kuningas toki voisi tältä kannalta katsoen
antaa anteeksi hänen kansalaistensa ymmärtämättömän
turhamielisyyden.

Kuningas näkyi etsivän neuvoa. Hän katsahti Colbertiin, mutta


tämä ei kasvojansakaan väräyttänyt. Sitten hän silmäsi d'Artagnania.
Tämä kohautti olkapäitään.

Tuo liike avasi sulun, joka päästi kuninkaan jo liiaksi pidätellyn


suuttumuksen valloilleen. Kun kukaan ei tiennyt, mihin tämä purkaus
johtaisi, pysyivät kaikki synkkämielisesti vaiti. Siten sai toinenkin
lähettiläs sitten suunvuoron, esittääkseen hänkin anteeksipyyntöjä.

Hänen puhuessaan ja sillävälin kun jälleen omaan haaveiluunsa


vaipunut kuningas kuunteli tätä hämmennyksestä värähtelevää
ääntä kuten hajamielinen ihminen tarkkailee vesiputouksen kohinaa,
d'Artagnan lähestyi vasemmalla puolellaan seisovaa Saint-Aignania ja
virkkoi äänenpainolla, joka oli laskettu kuninkaan korvaan
ulottuvaksi:

"Oletteko kuullut uutista, kreivi?"

"Mitä uutista?" vastasi de Saint-Aignan.

"No, la Vallièrestä."

Kuningas säpsähti ja astahti vaistomaisesti puhujia kohti.

"Mitä hänelle sitten on tapahtunut?" kysyi de Saint-Aignan äänellä,


jonka sävyn voi helposti kuvitella.

"Heh, se lapsiparka on mennyt luostariin!" ilmoitti d'Artagnan.


"Luostariin?" huudahti de Saint-Aignan.

"Luostariin?" kirposi kuninkaalta kesken lähettilään puheen. Sitten


hän hovisäännön pakosta malttui, mutta kuunteli yhä.

"Mihin luostariin?" kysyi de Saint-Aignan.

"Chaillotin karmeliittinunnain."

"Chaillotin karmeliittinunnain! Mistä hitosta sen olette kuuluu?"

"Häneltä itseltään."

"Oletteko hänet nähnyt?"

"Minä hänet saatoin karmeliittinunnien luo."

Kuningas tarkkasi joka sanaa. Hänen sielussaan kuohui ja kohisi.

"Mutta miksi tämä pako?" tiedusti de Saint-Aignan.

"Siksi että tyttöparka eilen karkoitettiin hovista", vastasi


d'Artagnan.

Tuskin oli hän lausunut tämän, kun kuningas teki käskevän


liikkeen.

"Riittää, monsieur, riittää!" hän virkkoi lähettiläälle ja lähestyi sitten


kapteenia.

"Kuka täällä sanoo la Vallièren menneen luostariin?" kysyi hän.

"Herra d'Artagnan", vastasi suosikki.


"Ja onko tuo puheenne totta?" kysyi kuningas, kääntyä
muskettisoturiin.

"Totisen totta."

Kuningas puristi kätensä nyrkkiin ja kalpeni.

"Te lisäsitte vielä jotakin, herra d'Artagnan", sanoi hän.

"En tiedä enempää, sire."

"Te lisäsitte, että kreivitär de la Vallière oli karkoitettu hovista."

"Niin, sire."

"Ja onko sekin totta?"

"Tiedustelkaa, sire."

"Ja kenen toimesta?"

"Oh", sanoi d'Artagnan ikäänkuin katsoen sopimattomaksi, että


hän olisi todistajana siinä seikassa.

Kuningas hypähti, jättäen sikseen lähettiläät, ministerit, hovilaiset


ja politiikan. Leskikuningatar nousi; hän oli kuullut kaikki tai ainakin
arvannut lopun. Suuttumuksesta ja pelosta horjuen yritti Madamekin
nousta leskikuningatarta seuratakseen; mutta hän vaipui takaisin
nojatuoliinsa, jonka hän vaistomaisella liikkeellä sysäsi taaksepäin.

"Messieurs", virkkoi kuningas, "audienssi on päättynyt. Minä annan


kohta vastaukseni, tai pikemmin ilmoitan tahtoni Espanjalle ja
Hollannille."
Ja majesteettisella liikkeellä hän hyvästeli lähettiläät.

"Olkaa varuillanne, poikani", sanoi närkästynyt leskikuningatar,


"olkaa varuillanne, Te ette näy hallitsevan itseänne."

"Ah, madame", karjaisi nuori jalopeura peloittavasti liikahtaen,


"ellen hallitse itseäni, niin takaanpa varmasti vielä hallitsevani
ainakin niitä, jotka häpäisevät minua. Tulkaa kanssani, herra
d'Artagnan, tulkaa."

Ja hän lähti salista yleisen hämmästyksen ja kauhun vallitessa.

Kuningas astui alas portaita, aikoen rientää pihan poikki.

"Sire", virkkoi d'Artagnan, "teidän majesteettinne erehtyy tiestä."

"Ei, menen talliin."

"Tarpeetonta, sire; minulla on hevoset valmiina teidän


majesteetillenne matkalle."

Kuningas vastasi palvelijalleen vain silmäyksellä, mutta tämä


silmäys lupasi enemmän kuin kolmenkaan d'Artagnanin kunnianhimo
olisi rohjennut toivoa.

168.

Chaillot.

Manicamp ja Malicorne olivat kutsumattakin seuranneet


kuningasta ja d'Artagnania. He olivat molemmin hyvin älykkäitä
miehiä, mutta kunnianhimon kannustamana ehätti Malicorne usein
liian aikaisin esille, jotavastoin Manicamp monesti myöhästyi
laiskuutensa tähden. Tällä kertaa he ehtivät täsmälleen ajoissa. Viisi
hevosta oli varattu. Kuningas ja d'Artagnan sieppasivat niistä kaksi,
Manicamp ja Malicorne samaten. Viidennen selkään nousi eräs
ratsupoika.

Koko seurue karautti täyteen laukkaan. D'Artagnan oli varmaankin


itse valinnut hevoset: ne olivat oikeita levotonta tuskaa kärsivien
rakastavien ratsuja, sellaisia, jotka eivät juosseet, vaan lensivät.
Kymmenessä minuutissa saapui ratsujoukkue pöllyävässä
tomupilvessä Chaillotiin.

Kuningas ihan paiskautui alas satulasta. Mutta niin nopeasti kuin


hän tämän liikkeen tekikin, oli d'Artagnan jo hänen ratsunsa suitsissa
Ludvig nyökkäsi muskettisoturille kiitollisuutensa merkiksi ja heitti
ohjakset ratsupojalle. Sitten hän syöksähti pylväseteiseen ja
työnnältäen voimakkaasti ovea astui vastaanottohuoneeseen.
Manicamp, Malicorne ja ratsupoika jäivät ulkopuolelle; d'Artagnan
seurasi isäntäänsä.

Ensimmäisenä kiinnitti vastaanottohuoneessa kuninkaan huomiota


juuri Louise, ei polvillaan, vaan viruen maassa ison kivisen
ristiinnaulitunkuvan juurella. Tyttönen oli pitkällään kostealla
paadella suojaman puolihämyssä, sillä sinne pääsi päivä ainoastaan
ahtaasta, köynnöskasvien kokonaan verhoamasta ristikkoikkunasta.
Hän oli yksinään, tajutonna, kylmänä kuin kivi, jolla hänen ruumiinsa
lepäsi.

Nähdessään hänet tässä asennossa kuningas luuli hänen


kuolleeksi ja päästi kamalan parahduksen, joka sai d'Artagnanin
astumaan luo.
Kuningas oli jo kietaissut toisen käsivartensa neitosen ruumiin
ympäri, D'Artagnan auttoi hallitsijaansa nostamaan ylös
tyttöpoloisen, jonka kalman kosketus oli jäykistyttänyt. Ludvig otti
hänet kokonaan syliinsä, lämmittäen suudelmillaan jääkylmiä käsiä ja
ohimoita.

D'Artagnan veti koko voimallaan kellonnuorasta. Karmeliittisisaret


riensivät paikalle. Hurskaat neidot kiljahtivat paheksuvasta kauhusta,
nähdessään näiden miesten pitävän naista käsivarsillaan. Johtajatar
saapui myöskin. Mutta tuntien enemmän maailmaa kuin hovinkaan
hienot naiset hän ensi silmäyksellä eroitti kuninkaan siitä
kunnioituksesta, jota läsnäolijat hänelle osoittivat, samoin kuin siitä
käskijän sävystä, jolla tämä mullisti koko yhdyskunnan. Hallitsijan
nähdessään hän siis vetäytyi huoneeseensa, ollakseen
vaarantamatta arvokkuuttansa, mutta hän antoi nunnien tuoda
kaikenlaisia elvykkeitä, Unkarin kuningattaren hajuvesiä, mesiruohoa
ja paljon muuta, käskien sitäpaitsi sulkea ovet.

Oli jo aikakin; kuninkaan murhe alkoi käydä kovaääniseksi ja


toivottomaksi. Ludvig näkyi päättäneen lähettää hakemaan
lääkäriänsä, mutta silloin la Vallière tuli tajulleen.

Ensimmäiseksi hän silmänsä avatessaan näki jalkojensa juuressa


kumartuvan kuninkaan. Epäilemättä hän ei tuntenut tätä, sillä
häneltä pääsi tuskallinen huokaus.

Ludvig katseli häntä kiihkeästi.

Vihdoin tytön harhailevat silmät kohdistuivat kuninkaaseen. Hän


tunsi nyt ja ponnistausi irroittuakseen hänen syleilystään.

"Mitä!" sopersi hän. "Eikö uhrini ole vielä täytetty?"


"Oi, ei, ei!" huudahti kuningas. "Se ei täyty koskaan, sen minä
vannon teille."

Tyttö kohousi, niin heikko ja murtunut kuin olikin.

"Se on kuitenkin välttämätöntä", virkkoi hän, "se on


välttämätöntä, älkää pidättäkö minua."

"Minäkö sallisin teidän uhrautua?" huudahti Ludvig. "En koskaan,


en koskaan!"

"Hyvä", jupisi d'Artagnan, "on aika lähteä. Siitä hetkestä kun he


alkavat puhua, säästäkäämme heiltä korviemme huomio."

D'Artagnan läksi ulos, ja rakastavaiset jäivät kahden.

"Sire", jatkoi la Vallière, "ei sanaakaan enää, minä rukoilen, Älkää


turmelko ainoata tulevaisuutta, jota toivon, nimittäin pelastustani;
älkää hukatko kaikkeanne — kunniaanne pelkän oikun tähden."

"Oikun?" huudahti kuningas.

"Oi", virkkoi la Vallière, "nyt, sire, näen selvästi sydämeenne."

"Tekö, Louise?"

"Ah niin, minä!"

"Selittäkää."

"Käsittämätön, järjetön hurmaus voi teistä hetkellisesti tuntua


riittävältä puolustukselta; mutta teillä on velvollisuuksia, jotka eivät
salli teidän rakastaa tällaista tyttöraukkaa. Unohtakaa minut."
"Minäkö unohtaisin teidät?"

"Se on jo tehty."

"Mieluummin kuolisin!"

"Sire, te ette saata rakastaa sitä, jonka olette sallinut kuluttaa


tämän yön niin julmasti."

"Mitä sanottekaan? Selittäkää toki, mitä tarkoitatte."

"Sanokaa, ettekö eilen aamulla pyytänyt minua rakastamaan teitä?


Mitä lupasitte minulle vastavuoroon? Lupasitte, että suuttuessanne
minuun ette koskaan sallisi puoliyön teitä yllättää ennen kuin olisitte
tarjonnut sovintoa."

"Oi, suokaa minulle anteeksi, suokaa anteeksi, Louise! Minä olin


mustasukkaisuudesta mielipuolena."

"Sire, mustasukkaisuus on häijy ajatus, joka katkaistuna versoo


uudestaan kuin rikkaruoho. Taaskin te joskus tulisitte luulevaiseksi ja
surmaisitte minut kokonaan. Armahtakaa minua ja antakaa minun
kuolla."

"Vielä tuollainen sana, mademoiselle, niin näette minun heittävän


henkeni jalkojenne juureen."

"Ei, ei, sire, minä tiedän paremmin, minkä arvoinen olen. Uskokaa
sanani, niin ette syöksy turmioon kaikkien halveksiman poloisen
tähden."

"Oi, nimittäkääpä minulle ne, joita te syytätte, nimittäkää ne!"


"Minulla ei ole tehtävänä valituksia ketään vastaan, sire; minä
syytän vain itseäni. Jääkää hyvästi, sire! Te antaudutte vaaraan,
puhutellessanne minua näin."

"Varokaa te, Louise; puhuessanne minulle näin te saatatte minut


epätoivoon, — ajatelkaa paremmin!"

"Oi, sire, sire! Jättäkää minut Jumalan haltuun, rukoilen sitä


teiltä!"

"Minä tempaan teidät Jumalaltakin!"

"Mutta ennen sitä", huudahti ahdistettu lapsonen, "temmatkaa


minut niiden julmien vihollisten käsistä, jotka vainoavat henkeäni ja
kunniaani. Jos teillä on kylliksi voimaa rakastaa, olkaa siis kylliksi
voimakas minua puolustamaan. Mutta ei sitä, jota sanotte
rakastavanne, herjataan, ivataan, hänet on karkoitettu."

Ja viaton lapsonen, jota suru pakotti syytöksiin, väänteli


nyyhkyttäen käsiään.

"Teidät on karkoitettu!" huudahti kuningas. "Nyt kuulen tuon


sanan jo toistamiseen."

"Häpeällisesti, sire. Te näette hyvin, että minulla ei enää ole muuta


suojelijaa kuin Jumala, muuta lohdutusta kuin rukous, muuta turvaa
kuin luostari."

"Te saatte minun palatsini, saatte hovini. Oh, älkää enää pelätkö
mitään, Louise. Ne miehet tai pikemminkin naiset, jotka teidät eilen
häätivät, vapisevat huomenna edessänne. Mitä voin sanonkaan? Jo
tänä aamuna olen jyrissyt, uhannut. Voin päästää valloilleen
ukkosen, jota vielä pidätän. Louise, teidän puolestanne kostetaan
kovasti. Verikyynelillä he maksavat teidän kyyneleenne. Mainitkaa
minulle vain vihollisenne."

"En koskaan, en koskaan!"

"Miten sitten tahtoisitte minun iskevän?"

"Sire, ne, joita olisi iskettävä, kimmahduttaisivat kätenne takaisin."

"Oh, te ette minua laisinkaan tunne!" huudahti Ludvig,


tuskastuneena. "Ennemmin kuin peräytyisin, polttaisin koko
valtakuntani ja kiroisin sukuni, — niin, minä sivaltaisin poikki tämän
käsivarrenkin, jos käsivarsi olisi kyllin veltto jättääkseen
koskemattomaksi ketään, joka on asettunut vihamieliseksi kaikkein
suloisinta olentoa vastaan."

Ja näiden sanojen vakuudeksi Ludvig iski kiivaasti nyrkillään


tammiseen väliseinään, joka vastasi kolkolla kuminalla.

La Vallière pelästyi hänen tavatonta kiivauttansa. Tämän nuoren,


kaikkivaltiaan miehen vimmassa oli jotakin mahtavaa ja turmaista,
koska se ukkosilman lailla saattoi tuottaa kuolemaa. Hän, joka ei
luullut murheelleen löytyvän vertaa, tunsi itsensä voitetuksi tämän
uhkauksiin ja väkivaltaan puhkeavan murheen nähdessään.

"Sire", rukoili hän, "vielä kerran, poistukaa, minä rukoilen, Tämän


turvapaikan rauha on minua jo vahvistanut, minä tunnen itseni
tyynemmäksi Jumalan kädessä. Jumala on sellainen suojelija, jonka
edessä kaikki ihmisten pienet häijyydet raukeavat tyhjiin. Sire, vielä
kerran, jättäkää minut Jumalan haltuun."

"Sanokaa sitten suoraan", huudahti Ludvig, "että te että koskaan


ole minua rakastanut; sanokaa, että nöyryyteni ja katumukseni
hivelee ylpeyttänne, mutta että murheeni ei tuota teille tuskaa.
Sanokaa, että Ranskan kuningas ei teille enää ole rakastaja, jonka
hellyys voisi luoda onnenne, vaan itsevaltias, jonka oikku on
sydämestänne katkaissut viimeisenkin tunteellisuuden säikeen. Älkää
sanoko etsivänne Jumalaa, vaan pakenevanne kuningasta. Ei,
Jumala ei ole taipumattomissa päätöksissä mukana; Jumala sallii
katumuksen ja kuulee tunnontuskat; hän antaa anteeksi, hän tahtoo,
että rakastamme."

Louise vääntelehti kärsimyksestä kuullessaan nämä sanat, jotka


saivat veren tulena kiertämään hänen suonissaan.

"Mutta ettekö sitten ole kuullut?" sanoi hän.

"Mitä?"

"Ettekö ole kuullut, että olen karkoitettu, halveksittu,


halveksittava?"

"Minä teen teistä hovini enimmin kunnioitetun, rakastetun,


kadehditun naisen."

"Todistakaa minulle, että te ette ole lakannut minua


rakastamasta."

"Millä tavalla?"

"Paetkaa minua."

"Minä todistan sen teille olemalla teitä jättämättä."

"Mutta luuletteko siis, että sen sallisin, sire? Luuletteko, että


antaisin teidän julistaa sodan koko perhettänne vastaan? Luuletteko,
että antaisin teidän hyljätä äitinne, vaimonne ja kälynne?"

"Ah, vihdoinkin olette heidät nimennyt! He siis ovat tämän pahan


tehneet? Kaikkivaltiaan Jumalan kautta, minä rankaisen heitä!"

"Ja senpä vuoksi tulevaisuus minua peloittaakin, senvuoksi


kieltäydyn kaikesta, senvuoksi tahdon, että te ette kostaisi
puolestani. Kyllin kyyneleitä, hyvä Jumala, kyllin murhetta, kyllin
voivotuksia jo nytkin! Oi, koskaan en tahdo aiheuttaa valituksia,
murhetta tai kyyneliä kellekään. Olen liiaksi vaikeroinut, liiaksi
itkenyt, liiaksi kärsinyt!"

"Ja minun kyyneleitäni, minun murhettani, minun vaikerruksiani,


— ettekö niitä pidä minään?"

"Älkää taivaan nimessä, sire, puhuko minulle noin! Älkää taivaan


nimessä puhuko noin! Minä tarvitsen kaiken rohkeuteni uhrini
täyttämiseen."

"Louise, Louise, minä rukoilen sinua! Käske, määrää, kosta


puolestani tai anna anteeksi; mutta älä jätä minua!"

"Ah, on välttämätöntä, että me eroamme, sire!"

"Mutta sinä et siis ollenkaan rakasta minua?"

"Oi, Jumala tietää sen!"

"Valhetta, valhetta!"

"Oi, ellen teitä rakastaisi, sire, niin antaisin teidän menetellä


tahtonne mukaan, antaisin kostaa puolestani! Hyvitykseksi minulle
tehdystä loukkauksesta ottaisin vastaan tarjoamanne voitonriemun,
joka olisi niin suloista ylpeydelle. Nyt sitävastoin, näette, en halua
edes rakkautenne tuottamaa ihanaa korvausta. Ja kuitenkin on
teidän rakkautenne minun elämäni, sillä tahdoinhan kuolla, kun
luulin, että te ette minua enää rakastanut."

"Ah niin, niin, minä tiedän sen nyt, minä tunnen sen tällä hetkellä.
Sinä olet pyhin, kunnioitettavin kaikista naisista. Kukaan ei ansaitse
yhtä hyvin kuin sinä sekä minun rakkauttani ja kunnioitustani että
kaikkienkin kiintymystä ja arvonantoa; eikä kukaan joudukaan
saamaan niin suurta rakkautta osakseen kuin sinä, Louise, — kellään
ei ole niin suutta valtaa minuun nähden kuin sinulla! Niin, minä
vannon sinulle, että tällä hetkellä murskaisin maailman kuin
lasipallon, jos se olisi tielläni. Sinä vaadit minua tyyntymään,
antamaan anteeksi? Tapahtukoon niin, minä rauhoitun. Sinä tahdot
hallita lempeydellä? Hyvä, minä olen lempeä ja säyseä. Säädä vain,
miten minun on käyttäydyttävä, ja minä tottelen."

"Ah, hyvä Jumala! Mikä olen minä, tyttörukka, sanellakseni


tavuakaan teidänlaisenne kuninkaan ohjeeksi?"

"Sinä olet minun elämäni ja sieluni! Eikö sielu hallitse ruumista?"

"Oi, te siis rakastatte minua, kallis hallitsijani?"

"Langeten molemmille polvilleni, kädet ristissä, kaikella voimallani,


mitä Jumala on minulle suonut. Minä rakastan sinua kylliksi,
uhratakseni elämäni hymyhuulin, kun vain virkat sanasen!"

"Te rakastatte minua?"

"Ah niin!"
"Silloin ei minulla enää ole mitään toivomista tässä maailmassa…
Kätenne, sire, ja sanokaamme jäähyväiset! Olen saanut tässä
elämässä kaiken onnen, mitä voi osakseni tulla."

"Oi, ei, sinun elämäsi onni vasta alkaa ja ainiaaksi. Sinulle


tulevaisuuteni, sinulle kaikkeni! Ei enää näitä eron ajatuksia, ei enää
synkkää epätoivoa. Rakkaus on meidän jumalamme, se on
sydäntemme kaipuu. Sinä elät minulle, kuten minä elän sinulle."

Ja vaipuen tytön eteen kuningas suuteli hänen polviaan


sanomattoman riemun ja kiitollisuuden huumeessa.

"Oi, sire, sire, tämä kaikki on unta!"

"Miksi unta?"

"Siksi että minä en voi palata hoviin, ja miten taasen saattaisin


pakolaisena nähdä teitä jälleen? Eikö ole parempi ottaa nunnanhuntu
ja haudata luostariin holveihin teidän rakkaudellanne balsamoituina
sydämenne viime sykähdykset ja viimeinen tunnustuksenne?"

"Sinäkö pakosalla?" huudahti Ludvig XIV. "Kuka pidättää, kun minä


kutsun takaisin?"

"Oi, sire, jokin, mikä on meitä voimakkaampi: maailma ja ihmisten


mielipide. Ajatelkaa sitä; te ette voi rakastaa karkoitettua naista.
Hän, jonka äitinne on tahrannut epäluulolla, hän, johon kälynne on
rangaistuksellaan painanut polttomerkin, hän on arvoton teille."

"Hänkö arvoton, joka kuuluu minulle?"

"Niin, siinäpä se juuri onkin, sire: siitä hetkestä, kun


rakastajattarenne kuuluu teille, on hän arvoton."
"Ah, oletpa oikeassa, Louise, ja sinä olet perin herkkätuntoinen.
No hyvä, sinua ei ole karkoitettu."

"Oi, te ette ole kuullut Madamea, sen hyvin huomaa."

"Minä vetoan äitiini."

"Oi, te ette ole nähnyt äitiänne!"

"Hänkin? Louise-parka! Kaikki olivat siis sinua vastaan?"

"Niin, niin, Louise-parka, joka jo taipui myrskyn käsissä, kun te


tulitte, kun te lopullisesti hänet mursitte."

"Oi, anteeksi."

"Te ette siis taivuta toista enempää kuin toistakaan; uskokaa


minua, onnettomuus on korjaamaton, sillä minä en koskaan sallisi
teidän käyttää voimaanne ja valtaanne."

"Hyvä on, Louise: osoittaakseni sinulle, kuinka suuresti sinua


rakastan, teenkin sen, että menen Madamen puheille."

"Tekö?"

"Minä panen hänet peruuttamaan tuomionsa; minä pakotan."

"Pakotatte? Oh, ei, ei!"

"Se on totta; minä suostutan hänet."

Louise pudisti päätänsä.


"Minä rukoilen häntä, jos on tarvis", sanoi Ludvig. "Uskotko sen
jälkeen rakkauteeni?"

Louise kohotti päätänsä.

"Älkää koskaan nöyrtykö minun tähteni! Antakaa minun


mieluummin kuolla."

Ludvig mietti. Hänen piirteensä synkistyivät.

"Tahdon rakastaa yhtä paljon kuin sinä rakastat", virkkoi hän;


"tahdon kärsiä yhtä paljon kuin sinä olet kärsinyt. Olkoon se
sovituksenani sinun silmissäsi. Kas niin, jättäkäämme nämä joutavat
pikkumaisuudet; olkaamme surumme suuruiset, olkaamme yhtä
voimakkaat kuin rakkautemme!"

Näin sanoessaan hän kietaisi tytön syleilyynsä molemmilla


käsivarsillaan.

"Ainoa omaisuuteni, elämäni, tule mukanani", rukoili hän.

Tyttö teki viimeisen ponnistuksen, johon hän ei enää keskittänyt


kaikkea tahtoaan, sillä hänen tahtonsa oli jo voitettu, mutta silti
kaiken voimansa.

"Ei", vastusteli hän heikosti, "ei, ei! Minä kuolisin häpeästä!"

"Etpä, vaan sinä palaat kuningattarena. Kukaan ei tiedä


lähdöstäsi…
Vain d'Artagnan…"

"Onko siis hänkin minut pettänyt?"

"Miten niin?"
"Hän oli vannonut…"

"Minä olin vannonut, etten sanoisi mitään kuninkaalle", virkkoi


d'Artagnan pistäen siromuotoisen päänsä oven raosta, "ja sanani
pidin. Minä puhuin herra de Saint-Aignanille. Ei suinkaan ole minun
syyni, jos kuningas sattui kuulemaan vai kuinka, sire?"

"Se on totta, antakaa hänelle anteeksi", sanoi kuningas.

La Vallière hymyili ja ojensi muskettisoturille hennon valkoisen


kätensä.

"Herra d'Artagnan", sanoi kuningas ihastuneena, "lähettäkää


noutamaan neidille vaunut."

"Sire", vastasi kapteeni, "vaunut odottavat."

"Hei, siinäpä on oikea palvelijan esikuva!" huudahti kuningas.

"Onpa sinulta mennyt aikaa sen huomaamiseen", jupisi d'Artagnan


itsekseen, kuitenkin hyvillään kiitoksesta.

La Vallière oli voitettu; hiukan vielä epäröityään salli raukeudesta


horjuva tyttö kuninkaallisen rakastajansa viedä hänet mukanaan.
Mutta vastaanottohuoneen kynnyksellä hän riistäysi kuninkaan
käsivarsilta, palaten kivisen ristiinnaulitunkuvan luo, jota hän suuteli
lausuen:

"Jumalani, sinä olet minut vetänyt luoksesi! Jumalani, olet minut


jälleen työntänyt takaisin! Mutta sinun armosi on ääretön! Kun
palaan, unohda, että olen täältä poistunut, sillä kun minä jälleen
tulen luoksesi, tulen ainiaaksi."
Kuninkaalta pääsi nyyhkytys, d'Artagnan kuivasi kyyneleen. Ludvig
vei nuoren naisen pois, nosti hänet vaunuihin ja sijoitti d'Artagnanin
hänen viereensä.

Itse nousi hän ratsulleen ja karautti Palais-Royalia kohti, jonne


tultuaan hän ilmoitutti Madamelle, että tämän piti päästää hänet
hetkiseksi puheilleen.

169

Kuningas taivuttaa Madamen.

Siitä tavasta, jolla kuningas oli jättänyt lähettiläät, olisivat


vähimminkin tarkkanäköiset aavistaneet sotaa.

Lähettiläät itse, jotka eivät paljon tienneet hovin sisäisestä


elämästä, olivat ottaneet omaan lukuunsa tuon kuuluisan lauseen:
"Ellen hallitse itseäni, hallitsen ainakin niitä, jotka minua häpäisevät."
Ranskan ja Hollannin kohtaloiden onneksi oli Colbert seurannut heitä
antaakseen muutamia selityksiä. Mutta kuningattaret ja Madame,
hyvin tuntien, mitä heidän huonekunnissaan tapahtui, olivat nuo
sanat kuultuaan poistuneet hyvin peloissaan ja karvain mielin,
varsinkin Madame tunsi, että kuninkaan viha kohdistui erityisesti
häneen, mutta rohkeana ja liiankin korskeana oli hän
leskikuningattaresta tukea tavoittamatta vetäytynyt kotiinsa, elleipä
ilman levottomuutta, niin ainakin aikomatta välttää taistelua. Tuon
tuostakin Itävallan Anna lähetti tiedustamaan, oliko kuningas
palannut. Linnassa syntynyt hiljaisuus ja Louisen häviäminen tiesi
moninaista onnettomuutta, kun tunnettiin kuninkaan ylpeä ja närkäs
luonne. Mutta pitäen ryhtinsä kaikista kuiskituista huhuista
huolimatta Madame sulkeutui huoneisiinsa, kutsui Montalaisin
luokseen ja alkoi mahdollisimman tyynellä äänellä kuulustaa tytön
käsitystä tapahtumasta, Kaunopuheisen hovineidon juuri lopettaessa
esityksensä kaikenlaisin varoittelevin sanankääntein ja kehoittaessa
Madamea suvaitsevaisuuteen, jotta samaa sävyä osoitettaisiin
tarpeen tullen hänellekin, saapui herra Malicorne ilmoittamaan, että
kuningas oli tulossa prinsessan puheille.

Montalaisin arvoisan ystävän kasvot kuvastivat äärimmäistä


jännitystä; oli ilmeistä, että kuninkaan pyytämästä puhelusta koituisi
mielenkiintoisimpia lukuja siihen kuninkaitten ja ihmisten sydänten
kuvaukseen.

Madame jonkun verran hämmentyi lankonsa tulosta; hän ei ollut


odottanut Ludvigin toimivan näin pian eikä varsinkaan ollut ottanut
lukuun, että hän ryhtyisi asiaan aivan suoranaisesti. Naiset, jotka niin
nokkelasti käyvät epäsuoraa sotaa, ovat aina paljon
taitamattomampia ja heikompia, kun on avoin taisteluhaaste
vastaanotettava. Madame, sanoimme, ei kuitenkaan ollut niitä, jotka
peräytyvät; hänellä oli päin vastainen vika tai ansio: hän oli
uhkarohkea. Malicornen tuoma viesti vaikuttikin häneen sotatorven
lailla, joka ilmoittaa vihollisuudet alkaviksi. Hän otti ylpeästi ylös
haastehansikkaan.

Parin minuutin kuluttua kuningas nousi portaita. Punakkana


ratsastuksestaan, vaatteet pölyssä ja epäjärjestyksessä hän esittäysi
ilmeiseksi vastakohdaksi hienosti ja huolellisesti puetulle Madamelle,
joka kalpeni ihomaalinsa alla. Ludvig istuutui ilman esipuheita.
Montalais läksi huoneesta. Madame asettui istumaan vastapäätä
kuningasta.
"Sisareni", virkkoi Ludvig, "tietänette, että neiti de la Vallière on
poistunut asunnostaan tänä aamuna ja että hän murheessaan ja
epätoivossaan on paennut luostarin turviin."

Nämä sanat lausuessaan oli kuninkaan ääni tavattoman liikuttunut.

"Vasta teidän majesteettinne ilmoittaa sen minulle", kierteli


Madame.

"Olisin luullut teidän saaneen sen tietää tänä aamuna lähettiläiden


vastaanoton aikana", sanoi kuningas.

"Teidän liikutuksestanne, sire, kyllä arvasin, että jotakin erityistä


oli tapahtunut, mutta minä en ollut asiasta tarkemmin selvillä."

Avomielinen kuningas kävi asiaansa suoraan.

"Sisareni", sanoi hän, "miksi lähetitte pois neiti de la Vallièren?"

"Koska hänen palveluksensa ei miellyttänyt minua", vastasi


Madame kuivasti.

Kuningas karahti purppuranpunaiseksi, ja hänen silmänsä


syöksivät salamoita, joiden hehku uhkasi lannistaa Madamenkin
rohkeuden. Hän hillitsi itsensä kuitenkin ja lausui:

"Teidänlaisellanne hyvällä naisella, sisareni, täytyi olla peräti


vakava syy karkoitukseen, joka ei häpäise ainoastaan nuorta tyttöä,
vaan tämän tytön koko perhettä. Tiedätte, että koko kaupunki
avoimin silmin tarkkailee hovin naisten käytöstä. Lähettää pois
hovineito on samaa kuin syyttää häntä rikoksesta tai ainakin
hairahduksesta. Mikä siis on se rikos, mikä on se hairahdus, johon
neiti de la Vallière on tehnyt itsensä vikapääksi?"
"Koska te asetutte neiti de la Vallièren suojelijaksi", vastasi
Madame kylmäkiskoisesti, "tahdon antaa teille selityksen jollaista en
olisi velvollinen kellekään esittämään."

"Ettekö kuninkaallekaan?" huudahti Ludvig äkäisesti liikahtaen.

"Te olette puhutellut minua sisareksi", virkkoi Madame, "ja minä


olen kotonani."

"Se ei muuta asiaa", sanoi nuori hallitsija häpeissään


kiihtymyksestänsä. "Te ette voi väittää, Madame, eikä kukaan
valtakunnassani voi väittää olevansa oikeutettu kieltäytymään
antamasta selityksiä minulle."

"Kun puhutte tuossa äänilajissa", vastasi Madame synkkänä


suuttumuksesta, "ei minulle jää muuta tehtävää kuin kumartaa
teidän majesteettinne edessä ja vaieta."

"Ei, puhukaamme asia selväksi."

"Neiti de la Vallièrelle suomanne suojelus pakottaa minut


esiintymään kunnioittavasti."

"Älkäämme haastako kaksimielisesti, sanon minä. Te tiedätte


hyvin, että Ranskan aateliston päämiehenä olen kaikille
vastuunalainen perheiden kunniasta. Te karkoitatte neiti de la
Vallièren tai kenet muun tahansa…"

Madame kohautti olkapäitänsä.

"Tai kenet muun tahansa, sanon", jatkoi kuningas, "ja kun tällä
menettelyllänne häpäisette asianomaista, vaadin minä selitystä,
vahvistaakseni tai peruuttaakseni tuomion."
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebooknice.com

You might also like