0% found this document useful (0 votes)
31 views

Download ebooks file Scala Design Patterns Second Edition Ivan Nikolov all chapters

Ivan

Uploaded by

naehusamelka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views

Download ebooks file Scala Design Patterns Second Edition Ivan Nikolov all chapters

Ivan

Uploaded by

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

Get ebook downloads in full at ebookmeta.

com

Scala Design Patterns Second Edition Ivan Nikolov

https://ebookmeta.com/product/scala-design-patterns-second-
edition-ivan-nikolov/

OR CLICK BUTTON

DOWNLOAD NOW

Explore and download more ebook at https://ebookmeta.com


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

Learning Concurrent Programming in Scala Second Edition


Aleksandar Prokopec

https://ebookmeta.com/product/learning-concurrent-programming-in-
scala-second-edition-aleksandar-prokopec-2/

ebookmeta.com

Learning Concurrent Programming in Scala Second Edition


Aleksandar Prokopec

https://ebookmeta.com/product/learning-concurrent-programming-in-
scala-second-edition-aleksandar-prokopec/

ebookmeta.com

Functional Programming in Scala, Second Edition (MEAP V08)


Michael Pilquist

https://ebookmeta.com/product/functional-programming-in-scala-second-
edition-meap-v08-michael-pilquist/

ebookmeta.com

Taken by the Russian Boss 1st Edition Bella King

https://ebookmeta.com/product/taken-by-the-russian-boss-1st-edition-
bella-king/

ebookmeta.com
Averting a Global Environmental Collapse The Role of
Anthropology and Local Knowledge 1st Edition Thomas Reuter

https://ebookmeta.com/product/averting-a-global-environmental-
collapse-the-role-of-anthropology-and-local-knowledge-1st-edition-
thomas-reuter/
ebookmeta.com

Imagination and the University 1st Edition Jacob Bronowski

https://ebookmeta.com/product/imagination-and-the-university-1st-
edition-jacob-bronowski/

ebookmeta.com

Spectral and Imaging Cytometry Methods and Protocols 2nd


Edition Natasha S Barteneva Ivan A Vorobjev

https://ebookmeta.com/product/spectral-and-imaging-cytometry-methods-
and-protocols-2nd-edition-natasha-s-barteneva-ivan-a-vorobjev/

ebookmeta.com

A Guide to Gender 2nd Edition The Social Justice Advocate


s Handbook Sam Killermann

https://ebookmeta.com/product/a-guide-to-gender-2nd-edition-the-
social-justice-advocate-s-handbook-sam-killermann-3/

ebookmeta.com

Overcoming Obstacles in Drug Discovery and Development:


Surmounting the Insurmountable■Case Studies for Critical
Thinking 1st Edition Kan He (Editor)
https://ebookmeta.com/product/overcoming-obstacles-in-drug-discovery-
and-development-surmounting-the-insurmountable%e2%80%95case-studies-
for-critical-thinking-1st-edition-kan-he-editor/
ebookmeta.com
The Stigma of Disease and Disability Understanding Causes
and Overcoming Injustices 1st Edition Patrick W Corrigan
Editor
https://ebookmeta.com/product/the-stigma-of-disease-and-disability-
understanding-causes-and-overcoming-injustices-1st-edition-patrick-w-
corrigan-editor/
ebookmeta.com
Scala Design Patterns
Second Edition

Design modular, clean, and scalable applications by applying


proven design patterns in Scala

Ivan Nikolov

BIRMINGHAM - MUMBAI
Scala Design Patterns
Second Edition
Copyright © 2018 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 or its dealers and distributors, will be held liable for any damages caused or alleged to
have been 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.

Commissioning Editor: Aaron Lazar


Acquisition Editor: Sandeep Mishra
Content Development Editor: Akshada Iyer
Technical Editor: Abhishek Sharma
Copy Editor: Safis Editing
Project Coordinator: Prajakta Naik
Proofreader: Safis Editing
Indexer: Pratik Shirodkar
Graphics: Jisha Chirayil
Production Coordinator: Shantanu Zagade

First published: February 2016


Second edition: April 2018

Production reference: 1060418

Published by Packt Publishing Ltd.


Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.

ISBN 978-1-78847-130-5

www.packtpub.com
mapt.io

Mapt is an online digital library that gives you full access to over 5,000 books and videos, as
well as industry leading tools to help you plan your personal development and advance
your career. For more information, please visit our website.

Why subscribe?
Spend less time learning and more time coding with practical eBooks and Videos
from over 4,000 industry professionals

Improve your learning with Skill Plans built especially for you

Get a free eBook or video every month

Mapt is fully searchable

Copy and paste, print, and bookmark content

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.
Contributors

About the author


Ivan Nikolov is a technical architect based in London. He works in the ad tech industry and
uses Scala in combination with libraries and technologies such as Spark, Hadoop,
RabbitMQ, Kafka, SQL and NoSQL stores, and Akka. He also uses other JVM and scripting
languages. Some of the projects Ivan has worked on include a large-scale real-time machine
learning platform, batch processing solutions, and high load APIs. Ivan also likes getting
involved with open source projects, whether it be to contribute or get inspiration and good
ideas.

I would like to thank Felix and Tasia and my mother, Veronika, for their interest in this
book and everything I do. Thanks to Becky for dealing with me working until late in the
evenings and all of her support.

Finally, thanks to everyone involved in publishing this book—editors, technical reviewer,


and people I haven't been in touch with but have invested their time in making sure that
everything went smoothly.
About the reviewer
Vasilis Nicolaou is a software engineer, Linux and FOSS hobbyist and enthusiast. He began
his career at CERN as a Linux developer and now works for BookingGo as a senior
software engineer developing microservices and distributed system solutions with Scala
and Akka.

Packt is searching for authors like you


If you're interested in becoming an author for Packt, please visit authors.packtpub.com and
apply today. We have worked with thousands of developers and tech professionals, just
like you, to help them share their insight with the global tech community. You can make a
general application, apply for a specific hot topic that we are recruiting an author for, or
submit your own idea.
Table of Contents
Preface 1
Chapter 1: The Design Patterns Out There and Setting Up Your
Environment 7
Design patterns 8
Scala and design patterns 8
The need for design patterns and their benefits 9
Design pattern categories 9
Creational design patterns 10
The abstract factory design pattern 11
The factory method design pattern 11
The lazy initialization design pattern 11
The singleton design pattern 12
The object pool design pattern 12
The builder design pattern 12
The prototype design pattern 12
Structural design patterns 12
The adapter design pattern 13
The decorator design pattern 13
The bridge design pattern 14
The composite design pattern 14
The facade design pattern 14
The flyweight design pattern 14
The proxy design pattern 15
Behavioral design patterns 15
The value object design pattern 16
The null object design pattern 16
The strategy design pattern 16
The command design pattern 16
The chain of responsibility design pattern 17
The interpreter design pattern 17
The iterator design pattern 17
The mediator design pattern 17
The memento design pattern 18
The observer design pattern 18
The state design pattern 18
The template method design pattern 18
The visitor design pattern 18
Functional design patterns 18
Monoids 19
Monads 20
Functors 20
Table of Contents

Scala-specific design patterns 20


The lens design pattern 21
The cake design pattern 21
Pimp my library 21
Stackable traits 21
The type class design pattern 21
Lazy evaluation 22
Partial functions 22
Implicit injection 22
Duck typing 22
Memoization 22
Choosing a design pattern 23
Setting up the development environment 23
Installing Scala 24
Tips for installing Scala manually 24
Tips for installing Scala using SBT 25
Scala IDEs 25
Dependency management 26
SBT 26
Maven 30
SBT versus Maven 34
Summary 35
Chapter 2: Traits and Mixin Compositions 36
Traits 36
Traits as interfaces 37
Mixing in traits with variables 38
Traits as classes 38
Extending classes 39
Extending traits 40
Mixin compositions 41
Mixing traits in 41
Composing 41
Composing simple traits 42
Composing complex traits 43
Composing with self-types 44
Clashing traits 45
Same signatures and return types 46
Same signatures and different return types traits 46
Same signatures and return types mixins 47
Same signatures and different return types mixins 48
Multiple inheritance 49
The diamond problem 50
The limitations 51
Linearization 52
Rules of inheritance hierarchies 52
Linearization rules 53

[ ii ]
Table of Contents

How linearization works 53


Initialization 54
Method overriding 54
Testing traits 58
Using a class 58
Mixing the trait in 59
Mixing into the test class 59
Mixing into the test cases 60
Running the tests 60
Traits versus classes 61
Summary 61
Chapter 3: Unification 62
Functions and classes 62
Functions as classes 63
Function literals 63
Functions without syntactic sugar 64
Increased expressivity 65
Algebraic data types and class hierarchies 65
ADTs 65
Sum ADTs 66
Product ADTs 66
Hybrid ADTs 67
The unification 68
Pattern matching 68
Pattern matching with values 68
Pattern matching for product ADTs 70
Modules and objects 71
Using modules 71
Summary 73
Chapter 4: Abstract and Self Types 74
Abstract types 74
Generics 75
Abstract types 76
Generics versus abstract types 77
Usage advice 80
Polymorphism 80
Subtype polymorphism 80
Parametric polymorphism 81
Ad hoc polymorphism 82
Adding functions for multiple types 83
Self types 84
Using self types 84
Requiring multiple components 87
Conflicting components 88

[ iii ]
Table of Contents

Self types and the cake design pattern 90


Self types versus inheritance 90
Inheritance leaking functionality 91
Summary 93
Chapter 5: Aspect-Oriented Programming and Components 94
Aspect-oriented programming 94
Understanding application efficiency 95
Timing our application without AOP 97
Timing our application with AOP 98
Components in Scala 100
Using Scala's expressive power to build components 101
Implementing components 101
Self types for components 101
Summary 105
Chapter 6: Creational Design Patterns 106
What are creational design patterns? 107
The factory method design pattern 107
An example class diagram 107
A code example 109
Scala alternatives 111
What it is good for? 111
What it is not so good for? 111
The abstract factory 113
An example class diagram 114
A code example 114
Scala alternatives 115
What it is good for? 116
What it is not so good for? 116
Other factory design patterns 116
The static factory 116
The simple factory 117
Factory combinations 117
Lazy initialization 117
An example class diagram 118
A code example 118
What it is good for? 120
What it is not so good for? 120
The singleton design pattern 120
An example class diagram 120
A code example 121
What it is good for? 123
What it is not so good for? 123
The builder design pattern 124
An example class diagram 124

[ iv ]
Table of Contents

A code example 126


A Java-like implementation 126
Implementation with a case class 127
Using generalized type constraints 129
Changing the Person class 129
Adding generalized type constraints to the required methods 130
Using the type-safe builder 132
Using require statements 133
What it is good for? 134
What it is not so good for? 135
The prototype design pattern 135
An example class diagram 135
A code example 136
What it is good for? 137
What it is not so good for? 137
Summary 137
Chapter 7: Structural Design Patterns 138
Defining structural design patterns 138
The adapter design pattern 139
Example class diagram 139
Code example 140
The adapter design pattern with final classes 142
The adapter design pattern the Scala way 142
What it is good for 144
What it is not so good for 144
The decorator design pattern 144
Example class diagram 145
Code example 145
The decorator design pattern the Scala way 149
What it is good for 152
What it is not so good for 152
The bridge design pattern 153
Example class diagram 153
Code example 154
The bridge design pattern the Scala way 156
What it is good for 158
What it is not so good for 158
The composite design pattern 158
Example class diagram 159
Code example 160
What it is good for 162
What it is not so good for 162
The facade design pattern 163
Example class diagram 163
Code example 164

[v]
Table of Contents

What it is good for 166


What it is not so good for 166
The flyweight design pattern 166
Example class diagram 167
Code example 168
What it is good for 171
What it is not so good for 171
The proxy design pattern 171
Example class diagram 172
Code example 173
What it is good for 175
What it is not so good for 175
Summary 175
Chapter 8: Behavioral Design Patterns – Part One 177
Defining behavioral design patterns 177
The value object design pattern 178
An example class diagram 178
A code example 179
Alternative implementation 181
What it is good for 181
What it is not so good for 181
The null object design pattern 181
An example class diagram 182
A code example 182
What it is good for 185
What it is not so good for 185
The strategy design pattern 185
An example class diagram 186
A code example 186
The strategy design pattern the Scala way 190
What it is good for 191
What it is not so good for 191
The command design pattern 192
An example class diagram 192
A code example 193
The command design pattern the Scala way 195
What it is good for 197
What it is not so good for 197
The chain of responsibility design pattern 197
An example class diagram 198
A code example 199
The chain of responsibility design pattern the Scala way 203
What it is good for 204
What it is not so good for 204

[ vi ]
Table of Contents

The interpreter design pattern 205


An example class diagram 205
A code example 206
What it is good for 209
What it is not so good for 209
Summary 209
Chapter 9: Behavioral Design Patterns – Part Two 210
The iterator design pattern 211
Example class diagram 211
Code example 212
What it is good for 213
What it is not so good for 214
The mediator design pattern 214
Example class diagram 215
Code example 216
What it is good for 219
What it is not so good for 219
The memento design pattern 219
Example class diagram 219
Code example 220
What it is good for 224
What it is not so good for 224
The observer design pattern 224
Example class diagram 225
Code example 226
What it is good for 228
What it is not so good for 228
The state design pattern 229
Example class diagram 229
Code example 230
What it is good for 231
What it is not so good for 232
The template method design pattern 232
Example class diagram 232
Code example 233
What it is good for 236
What it is not so good for 236
The visitor design pattern 237
Example class diagram 237
Code example 238
The visitor design pattern the Scala way 242
What it is good for 245
What it is not so good for 245
Summary 246

[ vii ]
Table of Contents

Chapter 10: Functional Design Patterns – the Deep Theory 247


Abstraction and vocabulary 248
Monoids 248
What are monoids? 249
Monoids in real life 250
Using monoids 251
Monoids and foldable collections 251
Monoids and parallel computations 253
Monoids and composition 256
When to use monoids 258
Functors 259
Functors in real life 260
Using our functors 260
Monads 261
What is a monad? 262
The flatMap method 262
The unit method 263
The connection between map, flatMap, and unit 263
The names of the methods 264
The monad laws 265
Monads in real life 267
Using monads 268
The Option monad 268
A more advanced monad example 272
Monad intuition 278
Summary 279
Chapter 11: Applying What We Have Learned 280
The lens design pattern 281
Lens example 281
Without the lens design pattern 282
Immutable and verbose 282
Using mutable properties 283
With the lens design pattern 284
Minimizing the boilerplate 286
The cake design pattern 287
Dependency injection 287
Dependency injection libraries and Scala 287
Dependency injection in Scala 288
Writing our code 288
Wiring it all up 295
Unit testing our application 297
Other dependency injection alternatives 298
Implicits for dependency injection 298
Reader monad for dependency injection 299
The pimp my library design pattern 299
Using pimp my library 299

[ viii ]
Table of Contents

Pimp my library in real life 302


The stackable traits design pattern 302
Using stackable traits 303
The type class design pattern 306
Type class example 306
Type class design pattern alternatives 310
Lazy evaluation 310
Evaluating by-name parameters only once 311
Alternative lazy evaluation 313
Partial functions 313
Partial functions are not partially applied functions 313
Partially defined functions 315
Implicit injection 317
Implicit conversions 318
Dependency injection using implicits 319
Testing with implicit dependency injection 321
Duck typing 322
Duck typing example 322
Duck typing alternatives 324
When to use duck typing 324
Memoization 325
Memoization example 325
Memoization alternatives 327
Summary 328
Chapter 12: Real-Life Applications 329
Reasons to use libraries 330
The Scalaz library 330
Monoids in Scalaz 331
Using monoids 331
Testing monoids 332
Monads in Scalaz 333
Using monads 334
Testing monads 338
The possibilities of Scalaz 338
Writing a complete application 339
Application specifications 339
Implementation 340
The libraries to use 342
Reading the application configuration 342
Reading the scheduler configuration 343
Scheduling tasks 343
Accessing a database 344
Executing console commands 344
Writing some code 344
Wiring it all up 354

[ ix ]
Other documents randomly have
different content
Flint to leave behind it a grain of Gold, but on the contrary, the
common Saturn will onely leave a grain of Silver. Who now can deny,
but that the grain of Gold proceedeth from the white Sand or Flint?
For no Gold could come from the Salts. This Specimen of Probation
is a palpable Argument, that Gold is contained in all Sand and Flints
of what Colour soever. But that there is no difference between one
Sand or Flint, and another, so that there is no more Gold in one than
another, I do not assert, for (in that respect) they greatly differ. Also
that the Sand of hot Regions containeth more Gold than that of cold
Countreys, is in no wise to be doubted, as every prudent Man will
easily think. For we have let down this Specimen of Probation, onely
to the end that you may find Gold to be in all the Sand and Flints of
the whole World.

The second Specimen of Probation.

R ecipe one part of white Flint or Sand, with which mix three or
four times as much Salt of Tartar, or of any other Alcaly, which
mixture put into a Crucible, so that it be not above a third part full,
because this mixture in the melting might rise up and run over the
Crucible; let it stand half an hour, that it may be well melted, and it
will be turned into a white transparent glass. Pour it out and dissolve
it in water, or rather in a Lixivium, and the Sand or Flint will be
dissolved, and converted into a thick Liquor. In this Liquor digest for
the space of an hour or two, half an Ounce of Filings or Raspings or
rather thin shavings of Lead, and the Lead will extract the spiritual
Gold from the Water of Flints, and will thence grow yellow: Which
being taken out of the Water dry, cupel it, and you shall find a grain
of Gold. Also cupel another half Ounce of the same Lead, and you
shall find a grain of Silver, as is commonly wont to be had from all
Lead, from which you may be certain that white Flints and Sand,
contain spiritual Gold, which becometh corporeal with Metals.

A Third Specimen of Probation.

D issolve Saturn in Áqua Fortis, and pour into the solution Salt
water, and all the Lead will fall from the Water like a white
Powder: mix three parts of this edulcorated and dryed Calx of Saturn
with one part of Sand, to which add half so much of the Salt of a
Lixivium or other Alcaly; which mixture put into an Iron Crucible, into
which you have first put some bits of Iron, which being covered,
suffer it to melt for the space of full half an hour, untill the sharp
Spirits of Salt which were in the Lead be mortified by the Iron, for
then the Saturn is reduced and rendered corporeal, which being
poured out into a Cone, the Regulus of Saturn falleth to the bottom,
which you may wash with Salt-peter as we have taught above, or
purge it from the Fæces on the Treib Scherbe [or Muffle] weigh it
exactly by the lesser Probatory Weights, weigh also as much of any
other common Lead, which is not melted with Sand, cupel each by it
self, and that Lead which was melted with the Sand, will leave a
grain of Gold in the Cupel, but the other common Lead leaveth onely
a grain of Silver. Which sufficiently proveth that there is Gold in all
Sand, none excepted. But I do not assert that all Sand containeth so
much Gold as that it may be thence extracted with profit. Because
some Sand is poor, other rich, another richer. Therefore whosoever
intendeth any profit by this ought before hand to know the
difference of Sand and Stones, that he may not lose his labour. The
which may easily be found out by experience, to wit, if you do
nothing in great Quantities, before you have made trial in lesser, that
is, such as may be performed by the lesser Specimens of Probation.

A Legitimate and Infallible way and manner of finding out and


proving every Flint, Stone, and Sand, whether it containeth much or
little Gold.

R ecipe four ounces of Sand, Flint, or other Stones or Rocks,


which you have a mind to prove; heat them red hot in a
Crucible, and cast them so into cold Water, where they will become
tractable, and may easily be brought to fine Powder, to those four
ounces of powdered Flints, Sand or Stones, put into a small Glass
Cucurbit, pour two ounces of Aq. Regis, that the Sand may be well
moistned; set the Cucurbit upon warm Sand for half an hour, and
the Aqua Regis will attract to it self the Gold which is contained in
the Sand or Flint. To which if two ounces of hot Water be poured
into the Cucurbit, and mixed by a strong shaking it together, and
filtred through a brown Paper, the Water with the Gold goeth
through the filter, and the Sand will remain in the Paper, to which if
you pour a little common Water, and let it run through it will take out
the residue of the Gold, which yet adhereth to the Sand, which is to
be added to the first. Upon this Solution if you pour a Lixivium, but
rather Spirit of Urine; that Lixivium or Spirit of Urine, mortifieth the
Aqua Regis and precipitateth the Gold which is in it in form of a
yellow Powder, from which the Water is to be poured off, and the Sol
to be edulcorated with fresh Water, and dryed, and that very warily,
because Gold of this sort, when it groweth hot, fulminateth, so that
it is shattered into minute parts. To this fulminating Gold if you add a
little common Sulphur, and make it red hot in a Crucible, it doth not
fulminate. If you reduce such a Calx of Gold mixed with Borax in a
clean Crucible, you will find how much Gold that four Ounces of
Sand or Flint contained. N. B. Except the Sand or Flint should
happen also to be impregnated with Iron, which would render the
Sol brittle and pale. For in that case, the Sol precipitated from the
Aqua Regia, and burned with Sulphur would not flow with Borax,
because the Iron being mixed with it, would adulterate the
Probation: But if you cupel such Gold partaking of Iron, with Saturn,
the Iron may be separated from the Sol, and the proof will be void
of errour. N. B. That Sand and Flints, may indeed be proved another
way, but seeing this which we have here prescribed, is easie to be
practised, we will rest in that.
But this one thing is also necessary to be known, viz. It is indeed
true, that in all Sand and Flints there is Gold, as the above
mentioned proofs do witness; nevertheless know that there is a
difference between native, corporeal, and solid Gold, and the volatile
spiritual first Ens of Gold. For the corporeal Gold is easily extracted
by the help of corrosive Waters or Salts; but the spiritual not so. And
because corporeal Gold is always elicited by the benefit of the above
mentioned Probation it may thence happen, that although in white
Sand there should plainly be no corporeal Gold, nevertheless by the
help of the aforesaid Probations it would be thence elicited, indeed
not much, nor no more than what the Lead which was used for the
proof, did contain of Silver: because the Lune in the melting or
dissolving hath attracted to it self the spiritual Gold, from the Flint or
Sand, so that it is thence tincted and transmuted into Gold. Which is
manifest in that the grain of Sol doth not exceed the magnitude of
the grain of Silver, which is gotten from other common Lead. But if
besides the spiritual, there be also corporeal Gold in the Sand, the
grain of Sol will necessarily exceed that of Luna, for the Silver which
was contained in the Saturn doth not vanish into Air but remaineth
and because it doth not remain the same Silver but passeth into
Gold, that change is ascribed to the notable Operation of the first
Ens of Gold or spiritual Gold in the Sand. Wherefore who soever
intendeth to extract Gold from Sand, Flint or Stones with profit,
ought to know certainly before by smaller experiments, that besides
spiritual, they also contain corporal Gold. For I have written this
Book onely upon the account of extracting from them corporal Gold,
leaving the spiritual Gold to Philosophers that of it they may make
their Stone. But necessity required that I should lightly touch at
those few things. For if according to my prescribed Probations, any
one in working should have found a grain of Gold of equal quantity
with the grain of Silver, he might wonder in his mind, which way the
Silver had made its escape, seeing that he had found Gold instead of
Silver. Wherefore I thought it necessary to shew the reason of that,
for the taking away all scruple from every ignorant mind. Wherefore
whosoever seeketh Gold from Sand or Stones, let him chuse such,
from which corporal Gold may be extracted with profit. For they will
afford him such profitable fruit, as the white Sand denieth. But that
for the performing my Specimens of Probation, I have taught to take
white Sand, I have done it for this reason, that I might make it
evident to every one that there is Gold in all Sand, but that it cannot
be extracted from all with gain. For white Sand or Flint is very often
void of corporal Gold, but never of spiritual, by which Silver may be
converted into good Gold. I might have passed by this admonition
with silence, seeing that those things are not necessary to be known
by the vulgar, in asmuch as corporal Gold will abundantly satisfy
their desire; but a Philosopher neither wanteth, nor seeketh corporal
Gold, but onely spiritual, to prepare of it a Tincture. Add, that to him
it is sufficiently known, in what subjects the first Ens of Gold is
plentifully contained. Hence, although the first Ens of Gold be also in
white Sand, as is manifest by the foregoing proofs, he useth not
that, but rather seeketh such Stones for his work, as contain much
Tincture. Neither also doth any true Philosopher so tie himself to this
or that subject onely, that he will not elicit his Tincture from any
other, inasmuch as it is evident to him that the first Ens of Gold may
be found in all things in the whole World. For wheresoever there is
Sulphur, there may also be had the first Ens of Gold, whence a
Tincture may be prepared. But it is evident that in all Vegetables,
Animals and Minerals there is Sulphur. For the matter of the Stone of
Philosophers, every where offereth it self, so that the poor as well as
the rich may attain it without cost, according to that saying of the
Philosopher; That their matter is every where obvious, and prepared
without money, trod under foot and thrown to Dunghils. So the true
Philosophers speak and write. But Sophisters, who falsly assume the
name of Philosophers, wandring up and down from Court to Court,
where they offer their service for the acquiring the Philosophers
Stone, by their lying Fables, perswade credulous Noble men, that the
matter of the Stone is to be sought in this or that place or mountain,
as in Hungary, Transylvania, the Forrest of Hercynia, Thuringia or
Bohemia, or in the Rocks of Sueden or Norway, and elsewhere.
Others again perswade credulous Persons, that the Stone of
Philosophers, can be made of nothing but common Gold, and
therefore require of their Patrons not onely some ounces, but some
pounds of Gold, for their own greater profit. One of those Pseudo-
philosophers was lately here at Amsterdam, who by perswading
certain Merchants, trickt them out of two and twenty Marks of Gold,
thence to make the Philosophers Stone. He indeed put the Gold into
the Vessel according to his own manner, before those Merchants,
giving to it a continuall Fire. But after much time being elapsed,
when they expected to reap the Fruit, he, who had plaid the
Philosopher, privately withdrew himself into I know not what
Countrey, and would not return to take out the two and twenty
marks of gold. Therefore the Merchants themselves being about to
take them out, found those solar Birds were flown, and had left
onely the empty nest. Which empty nest as yet lies in a place in this
City, nor doth any one know how to convert it to his own use. But if
the Merchant had given to that impostor in hand, onely two, or at
the most three ounces of gold, they had not received so great a loss.
But as they unadvisedly credited his fine Clothes, and his finer
words, so they were intollerably deceived.
A true Philosopher wanteth not so much gold for his Medicine,
inasmuch as if he bringeth but one half ounce to perfection, it may
suffice for his whole life, and may be in his own power to do the
same again as often as necessity shall require, so that he will have
no need to run up and down from one to another who are greedy of
gold, to blemish the noble art of Chymistry, and bring it into hatred
with the whole World.
Some years since, when I had written of the Prosperity of
Germany, and from a good intention had taught how Wine and Corn
might be concentrated, and in case of necessity, might be
commodiously carried from one Countrey to another, and there
safely kept in Garrisons or Fortresses for future use; fearing that at
sometime while the Shepherd slept, that most ravenous Wolf the
Turk might break into the German Fold, and cut the throats of what
Sheep he could not carry away. Against which, Farner with his
accomplices, hath set forth notorious Libels, and hath every where
traduced me for a false Prophet: Whose Calumnies I have not
opposed, because he hath sheltred himself under the protection of
Princes. Moreover, this Farner, with a consort of ruiners of fame, or
good name, have reproachfully wounded my Honour, by falsely
accusing my Writings, and traducing them for Lyes: And seeing that
almost all of them abide in great Men’s Courts, and have not put
their names to their invective Papers, I have not indeed been able to
reach them. But yet at length those Men of darkness, who have
concealed their names, that they might give the greater reputation
to their slanderous Papers, do come to be more and more known to
me. Besides at last the event hath shewed those things to be true,
which I had predicted should happen; to wit, that the depraved
Christians should be chastised by the Turks and Tartars. But it is to
be pitied that also Men of better note, should be ensnared and
captivated by the common judgment, by reason of that Company of
the Devils attendants. For the unerring truth declareth, that the
righteous scourge of God, will not be taken away from us, before
such spoils of a Man’s good name be restrained by the Magistrate.
Now, to return to our purpose, to demonstrate, that not onely
Gold, but also somewhat more rare; to wit, a true Tincture is hidden
in Stones, and by the help of Art may be extracted from them, which
the Ancients have hinted at in these words: Auro quid Melius?
Jaspis, &c. And that there is much Tincture contained in the Jasper, I
have long since inculcated in other places of my Writings. Paracelsus
highly commendeth Red Talck, Granates, Antimony, and Lapis Lazuli,
adding that Tinctures or the first Ens of Gold, may be gotten from
them by the help of sublimation. Moreover the first Ens of Gold, may
also be found in other Stones, especially in the Hematitis, Scythis,
Magnesia of Piedmont, Smiris, and others of that kind, in which it is
so fixed, that there is nothing wanting to obtain it but onely the way
of extracting, and giving it ingress by Sol. On the contrary, the first
Ens of Gold is indeed in Vegetable, Animal, and Mineral Sulphur,
Marcasites, and Antimony, and that abundantly, but so volatile that
Stones are to be preferred to them.
And although my intention in this Book extendeth no farther than
the extracting of Gold out of Stones, Sand, and Flints, yet nothing
hinders but that in a few words, I may also shew, that in Stones,
there is not onely fixed Gold, but also volatile, whence a true
Tincture may be perfected. Which Tincture I have not as yet made,
but nevertheless I am certainly perswaded that it is in no wise
impossible to be done. For whosoever can render the first Ens of
Gold, in Stones, volatile, and draw it out by Distillation, he will
continually obtain a gradatory water, whereby he may coagulate
every running Mercury into good Gold. But he that knoweth how to
joyn this volatile Gold with corporal Sol, to unite them and procure
ingress, may thence expect a far greater good. For the first Ens of
Gold is more conducible for the preparing Tinctures, than corporal
Gold, as one of the Philosophers hath signified in the following
words: Thou canst not make Gold or Silver, except thou shalt obtain
their first Ens. The first Ens of Gold, which is hidden in all Vegetables
and Animals, coagulateth Mercury also into a yellowness, but not
constant; but if it shall be fixed, it also coagulateth and fixeth with
constancy, but not before. Therefore it is most certainly true, that
where Sulphur is, there is also the first Ens of Gold; and where there
is the first Ens of Gold, there is also Tincture. Therefore seeing that
Sulphur may be found, in all things in the World, even in the
smallest Herb, it followeth that also from every Herb, Wood, Stone,
or Bone, a true Tincture may be prepared. Whosoever will believe,
let him, it matters little to me whether it be believed or not, I think
my self satisfied in that I have not put that light which I have
received under a Bushel, but have exhibited it to the World for
information. For the light conduceth nothing to him who is blind, and
resolveth to remain so. You shall find more in my third Century, as
also in the sixth part of my Pharmacopœa Spagyrica.

How it may be known whether Sand, Flints, and the like Stones,
being pregnant with Gold, contain much Gold, or but little.

W hite Sand and Flint, contain the least Gold of all; which Sand
indeed is never without Gold, although it cannot be extracted
from it with profit. In the white and red, there is more Gold than in
the white, nevertheless not always so much as will pay the cost. In
the yellow, brown, or black, there is commonly much Gold
contained, whensoever veins of white or yellow Sand run through
them, and especially when such Sand shineth with abundance of
small golden sparks, closely adhering to each other. In like manner
that Sand is rich in Sol, which is like to Talck, or when Stones are
found in it, in which there is red or brown Talck, even as Sol is
contained almost in every Talck, nevertheless in some more, in other
less.
All River Pebbles (which although outwardly they appear white,
yet when heated red hot and broken, are stained with yellowness,
and contain Sol) are in extracting sufficiently rich in Gold.
Green, yellow, or blue Stones, being transparent like horn [called
in the German Tongue Hornstein] are also for the most part fruitfull
in Gold. Also all red, dark-coloured and black Flints contain Gold,
with which Iron is frequently admixed, which in the extraction is
drawn out with the Sol, and weakneth the Menstruum, and
rendereth it unprofitable.
All Quarries or rocky Stones, whether they be found in the Earth
after the manner of Ducts, or whether they lie in the open Air, when
they are coloured, contain Gold. Every Hæmatites, and that which is
a kin to it, the Smiris, the Granate, and Lapis Lazuli, all contain Gold,
nevertheless always one more than another, so that some of them
are rich in Gold.
All Granates contain Gold, and besides Gold, also the first Ens of
gold; but they are endowed with so hard a body, that Aqua Fortis
cannot exercise its power upon them. But there may be a remedy
found, by whose help their extraction may be instituted.
In every golden Stone called Chrysocolla, Saphyr, Ruby, Amethyst,
and Hiacynth, there is gold, but difficult to be extracted. All Fluors or
things fluxing, which are applied to the Mines of Sol and Lune, for
the bringing their Oars to a flux or melting, whether they be of a
violet colour, or purple, yellow, red, or green) are all endowed with
unripe and volatile gold. Which if you shall make red hot, the colour
evaporateth like a green, yellow, or red smoke, leaving the Stones
white. But if any Man shall know how to intercept, and detain such
fugacious Sol, he may therewith coagulate Mercury into gold. In like
manner from all Stones, in which is the first Ens of gold, a green-
water may be extracted by the help of Distillation, in which Mercury
coagulateth it self into gold. The Ancient Philosophers have called
such a green-water, their Green Lyon, which devoureth gold, and of
it prepareth a Tincture for Lune and Mercury.
Concerning this matter, I could indeed say somewhat more, did
not the avarice and improbity of Men, who seek nothing but the
damage of their Neighbour, restrain me. Hence all those in which
any light of God shall arise, ought diligently to beware that they
communicate nothing of it to wicked Men, although they put on the
shape of an Angel. For Faith is now no where kept among Men, as
these following words of a golden Alphabet do witness.

Soli Deo tu Confidas,


Promissis hominum diffidas,
Deus solus fidem servat
A mundo fides exulat.
In God alone repose thy trust,
With Mens pretence be not beguil’d;
God onely keepeth Faith, is Just,
Which from the World is quite exil’d.

If many years ago, I had known those things which I now do, it
would have profited me much in being aware of the dissembled
sanctity of impostours. But what is past cannot be recalled: Let
these things at this time suffice to be spoken of the knowledge of
Sand and Stones, every Man may look further for himself, and
search out and learn more. If any Man findeth any good from what I
have written in this Book, let him give God thanks, and be mindfull
of the Poor; if not, let him look upon himself as unworthy to be
partaker of it. For I have here written more perspicuously, than any
Philosopher hath done before me, in which I rest. It now remains
that we should say something concerning the easie way, and
incomparable invention, by whose benefit Sol may be extracted from
Sand and Stones, in great quantity and with a considerable gain.
Which invention hath been hitherto unknown to the World, and it is
almost impossible that a better should be found. But that the
searcher into Art may see that this new invention of mine, is of all
the most easie for the extracting of Gold from Sand or Flints, and
that the World hath never known the like, I have thought fit to shew
in what this Compendium consists, and it is thus. It is sufficiently
known with what labour and costs the ancient Workers in Metals,
and even those at this day, have extracted, and do extract Gold from
Sand and Stones, viz. when first they burn the Oars or Stones, then
grind it in peculiar Mills accommodated to that purpose, with Argent-
vive and water, where the Argent-vive draweth to it self the Sol, and
the Stone goeth away in the washing, and the greatest part of the
Argent-vive is strain’d from the gold through Leather, which may
again serve for the same use. Then in Iron Retorts they drive out the
residue of the Argent-vive, which yet adhered to the Sol, which is
saved; then they melt the Sol. In which operation they lose much of
the Argent-vive, which in the grinding and washing goeth away: so
that often times the charge of the Mercury is no less than the gain of
the gold. Therefore by this way nothing can be gotten from a poor
Mine. But this is the easiest way they have to separate Sol from its
Oar or Stones.
Another way is, when they mix the washed Oar (which the
Germans call Schlicht) with its weight of Litharge, and melt it with
Bellows, then cupel the Regulus of Saturn, and so they obtain the
Sol which was in the Oar. Which way of melting, is also dear,
because much of the Lead is lost: But yet they are obliged to follow
this way, who know no better. Now I will compare my way with this,
that it may be evident which of them is the most easie and
profitable. As for my method of extracting, it chiefly depends upon
four singular Compendiums, by which the operation is rendred easie.
The first of which is a water of small cost, which may be copiously
prepared, without Distillation.
The second is a singular Metal, of which the Kettles or Pans are
made, in which the Stones or Sand is boiled with the water of small
cost, and yet are not corroded nor consumed. And when the water
shall have dissolved and imbibed the Sol in the Sand, the Oar, Sand,
or Stones, with the water are to be taken out of the boiling Vessel,
and put into another Vessel adapted to this use, with a bottom all
over perforated with small holes [like a Colender] and first covered
with inside, with a thin Matt, then the water will drop down through
the Sand and Matt into another Vessel placed under it; moreover
more hot water is to be poured upon the same Sand, and let to run
through it, which water will also extract the gold which as yet
remained in the Sand. And after this Elixiviation, the Sand, (which is
now of no use) is to be taken out of the filtering Vessel, and this
labour to be continued so long, untill no more Sand is to be
extracted.
The third Compendium is this, when the Lixivium of Gold, is
collected to a just quantity, a singular Water of small cost, is poured
into the Solution of Gold, whence all the Sol is precipitated from the
Solvent, the Solvent by inclination is decanted from the Calx of Sol,
and may again be used for the like extraction, seeing that it still
retaineth its strength, being nothing weakened by the precipitation.
Therefore we may use this Solvent a long time. And that which is
lost by pouring too and again, is of small charge, because it may be
recruited again by the like cheap Water. But if one should mortifie
that dissolvent with other contrary Lixiviums, to precipitate the Sol,
as otherwise is wont to be done, and I have taught above, about the
proving of Sand, what a loss should we undergo, if at every time we
should destroy our Solvent? Besides such an extraction is costly and
laborious, when made in glass or earthen Cucurbits.
But this extraction is almost of no charge, seeing that it may be
perfected in great Kettles, and the Gold thence precipitated without
loss of the Water. This extraction of Gold is like the extraction of
Salt-peter from Earth, where the Workmen also elixiviate one part of
the Earth, by the help of Water, which Earth they then throw away,
and in room of that put other Earth into the Vessel, which they also
elixiviate or wash, and that so often till they have elixiviated all their
Earth impregnated with Salt peter. And by the same reason we elicit
our Gold from Sand, as they make their Salt-peter.
The fourth Compendium is this, that the precipitated Calx of Sol,
after the Water is filtred from it, is taken out of the filter and dried,
and by the benefit of a certain singular good flux, not at all costly, is
reduced, so that in the melting nothing of the Gold is lost.
In those four Compendiums the whole work of our extraction
consisteth, as a building standing upon four Pillars, one of which
failing, the whole structure is ruined. He that knoweth those four
Compendiums may boldly enter upon the work, to extract Sol from
Sand and Stones: for then it will be a work of profit to him,
otherwise not, which I have declared for the information of every
man.
But that I have made none of those four Compendiums manifest,
let no man wonder, because I have been sufficiently hurt by the
slanderous Forgeries of cavelling Detractours. For when by reason of
their dull apprehension, they could not understand nor perform
those things which I had written openly and plain enough, they
falsly traduced my Writings, as abounding with lies.
Let these things suffice to be written at this time, concerning the
extraction of Gold out of Stones, Sand or Flints: which I doubt not
but will be of use hereafter to many indigent Persons. For although
all men should apply themselves to that extraction, yet they would in
no wise incommode one another, seeing there are Sand and Stones
every where obvious to all. And also the Salts for extracting are so
plentifully afforded, that nothing is wanting but a man to put his
hand to the work. But some one may here object and say: I do
indeed believe Glauber, that in the Sand and Stones of the East and
West Indies, Africa, Spain, Italy, France, and other hot Countries,
much Gold may be found, but who will remove his dwelling thither
to extract it? There is no need that any should go dwell in Africa, or
either Indies, thence to fetch us Gold, seeing that it may be had
sufficiently in Europe, and may be found in all cold places. It is well
known, that in many parts of Germany, Gold is elicited from the
Sand as well of small, as great Rivers and Lakes. But that more Gold
may not be had in Germany, which is temperate, than in cold
Norway, or Sweden, and less in Germany than in France or Spain, I
will not deny. Therefore we need no Commerce with thirsty Africa, or
America, as that with great peril of body and mind, we should seek
Gold thence, seeing that we have it in every Countrey of Europe,
and that not onely under ground in the Veins of the Earth, whence it
is to be digged out with great trouble, cost and labour; but it is also
every where manifest upon the Earth, where it is much more largely
and easily acquired. The most famous Monarch of Philosophers,
Paracelsus, in his Book of the Vexations of Alchymists saith: That
more Gold and Silver may be found above the Earth, than in its
profundity, and that oftentimes a Countreyman throweth a Stone at
a Cow, which is of greater value than the Price of the Cow. Which
thing indeed is certainly true, nevertheless whosoever will not with
Glauber believe it, let him remain in his unbelief. In Esdras, we reade
these words: There is much Earth of which Potters make their
Vessels, but a small quantity of Powder or Dust of which Gold is
made. Which words are commonly thus interpreted, that, by the
words powder or dust of which Gold is made, the Writer hath
understood the Stone of Philosophers. The which is very agreeable
to truth, but yet no Earth is found void of metals, nevertheless all
are not so rich, as to afford any profit in the extracting. On the
contrary all Stones and Sand (although every of them doth not
contain corporal Sol so largely, as to be thence extracted with gain)
rejoyce in the first Ens of Gold, or such a Calx by whose benefit Gold
may be made. Which powder, if we know how to extract from them,
we may make it better than Gold it self. But seeing such an Aurifick
Calx is very largely diffused in Sand or Stones, and cannot be thence
hammered out, but is extracted by Art alone, therefore the blind
Covetours of Gold, with the Ignorant, will not believe it, because
they know not how to perfect it. Hence an Art of this kind was by
the Philosophers kept most secret, where Paracelsus speaking of the
first Ens of Gold, saith that it may be elicited by sublimation. Basilius
writeth that the preparation of the universal Tincture, may be
compared to the distillation of a burning Spirit from the Lees of
Wine. A comparison sufficiently perspicuous! For even as in a great
quantity of Wine or Beer, there is hidden but a small quantity of
good Spirit, and the residue is nothing but an unprofitable mud, but
nevertheless that little Spirit, by the help of distillation is always
extracted from the great quantity of unprofitable mud, with gain,
and is concentrated into a very subtile penetrating Spirit, of which
one spoonfull is more to be esteemed than a whole pail full of Lees.
By such means the Philosophers would have us extract by Art, that
first Ens or form of Gold being very far dispersed in Sand and
Stones, and concentrate or bring it into a small compass, of which,
but asmuch as the magnitude of a Pease, is of greater worth than a
huge Mountain of unprofitable Earth. Moreover, this I will not
conceal, that throughout all Germany, in and about the Rivers may
be found Stones, which are sufficiently rich in Gold and Silver, and
moreover if you break them into pieces, you shall find within them
little Holes and Caverns, which abound with a yellow or brown
Powder, which if any one shall take out, and melt it together with
Borax, he will acquire Sol mixed with Silver. But as yet, I never saw
any man, who knew this sort of stones, and much less that golden
Calx which is hidden in them. Which thing without doubt they have
passed by, by reason of their negligence, not loving or seeking to
know the physical Magnalia of God. I have found many the like
stones in the sandy Hills about Utrecht, and in other Sand-pits of this
Belgick Nation, but more about the Banks of the Rhine, and the Isle,
as also the Coast of the Southern Sea, some of which stones I have
yet by me. Also in the rough places of Walavia you may find much
Sand and Stones, which contain corporal Gold. But there is no man
knoweth any thing of them. And this might be of great use to
Children, if they were placed for a time in the Shop or Workhouse of
some Artist, of whom they might learn, whence in any case of
necessity they might be able to sustain themselves. But the rich,
relying upon their own fortunes, think that they have Wealth enough
for their Children, but if any adverse fortune shall chance to befall
them, as their Houses to be burnt, or their Ships robbed by Pyrates
of their rich Merchandizes, or be cast away by Tempests, or their
Debtours break and run away in their Debts, then they know not
which way to turn themselves; and because they have learned no
Art, whereby to get their living, they commonly degenerate into men
of a desperate life. For one leaveth his Wife and Children, and goeth
into the Indies, where not a few have become a Prey to wild Beasts
or Cannibals. Another, for a small stipend or pay, selleth his Freedom
to fight by Sea and Land, untill like a mad Dog he is miserably slain.
[I have heard that it is a Custom in Germany, that a man may play
away, pawn, or sell his Liberty or Freedom, which being once gone,
he becomes a Vassal or Slave to the publick Service of the Prince or
State, during his Life.] Others, (after they have consumed and
wasted all their substance, and have learned nothing that is gainfull
in their youth, whence they might honestly maintain themselves and
Families) betake themselves to a vitious kind of life, till they perish in
it. To have truely learned Mechanick Arts, indeed helpeth much in
fortunate times; but when the times happen to be troublesome and
difficult, and many men in the same City exercise one and the same
Art, one often hurts another, by eating the Bread out of his mouth,
and reduceth him to straits. But if a Physician knoweth somewhat
besides the Profession of Physick, by which he may obtain a Living,
he will have no need to make so many Visits to the Sick out of a
pressing desire and expectation of getting mony for his diligent
attendance. Therefore Hermetick Philosophy and Medicine, with their
Cousen German natural Alchymy, are the most excellent of all Arts,
and will so remain to the End of the World.
Seeing therefore that such great Treasures (as we have heard) are
hidden in the despised Earth, and in such subjects as are every
where trampled under foot, wherefore should we not extract them,
for an honest maintenance, and defence against the injury of the
times? Why should we not leave India to the Indians, and have
regard to our own Europe, which abundantly affordeth whatsoever
we need for the sustentation of Life? I cannot but say again and
again, that were I but ten years younger than I am, I would not
cease, but for the good of the publick, would publickly teach, and
demonstrate to the Eye, true Philosophy, Medicine, and Alchymy. But
my glass being almost run, I must commit the care of this labour to
others who are younger and have greater strength of Body.
Therefore in the mean time, whatsoever good I can do my
Neighbour by wholsome Writings, I will not omit. I intend shortly
(God favouring my design) to publish many secrets, hitherto
unheard of. Nothing now remains but to close this little Treatise with,
The End.
Glory be to God alone.
An Admonition to the R E A D E R.

W
hatsoever I have written in this little Book of the
compendious extracting of Gold, out of Sand and Stones,
is so true, that nothing at all is to be doubted concerning
it: Nevertheless after this Treatise was gone to the Press, another
way, and that much better came into my mind, by the benefit of
which, Gold may be extracted with a much greater expedition, than
by the help of the former. Because for the operation of this last way,
there is no need of any Kettles or Pans made of a certain singular
Metal, but the extraction may be made in quantity without any
boyling, in such Vessels as are every where in hand, and may be
had, so that one man in one day, may by an easie business perform
the extraction of a thousand Pounds weight of Sand. Which method
is indeed much to be preferred to the former. Wherefore I could not
but also notifie this way of extraction. What seekest thou? If I shall
find that those my profitable inventions are gratefully received, I will
not neglect officiously to serve the publick, in this present evil Age,
and in the worser to come, by publishing the same. With which,
benevolent Reader, I commit thee to the Divine Care and Protection.
Dated at Amsterdam the 26th. Day of July 1664.
A

Spagyrical Pharmacopœa:
OR

D I S P E N S A T O R Y.
Being an exact description by what means,
profitable, efficacious, and penetrating
Medicines may be made, and prepared out of
Vegetables, Animals, and Minerals; after an
unwonted and easie method.

P A R T I.

To the well minded Reader.

S
ome or other will perhaps wonder at, and fain know what the
reason should be of my describing this Pharmacopœa
Spagyrica, or Chymical Dispensatory, especially when they
consider that there are not onely found various preparations of
divers Chymical Remedies in my Books that I have published, but
also many such innumerable Writings of such kind of businesses, are
publick even from the days of old down to this very day, both
profitable ones (of which the number is very small) and also
unprofitable ones (of which there are a great multitude,) insomuch
that it might seem altogether needless to commit to the Press any
more matters of that kind. To satisfie such a one that thus enquires,
I judge it well worth my while to demonstrate in this place, that it is
not onely very profitable, but also highly necessary, well to
distinguish between good and tried Medicines, and such as are not
proved ones, not because you should neglect, correct, reject, and
suppress other Mens Writings, and to esteem highly of mine. No
such matter, for I well know that none can give more than he
possesseth, and if any one doth (out of a candid mind) bring to light
any thing for the profit and benefit of his Neighbour, how vile soever,
and mean the thing be, yet is it to be most thankfully accepted of;
and therefore let no body be so proud, as to presume upon the
rejecting of the industry and labour of another Man, but rather extoll
it with praises, though he himself could have done better. And so by
what is here spoken, I would hint unto you that the very reason why
I have published this small Treatise, is this, viz. that my inventions
may reach out an helping hand to poor afflicted mankind, and that I
may assist them in a Christian manner, according to the will and
command of the most high. And although I have already described
the preparation of many profitable Medicines, as well out of
Vegetables and Animals, as out of Minerals, in my Philosophical
Furnaces, by the use of which in case of necessity, every curable
Disease may be sufficiently enough driven out and carried off; yet
nevertheless it hath seemed expedient unto me, to set forth this
little Work under three Parts, each of which parts shall contain
singular Medicaments as for example. The first Part shall
comprehend such Medicines, as proceed from Vegetables, the
second Part, such as proceed from Animals, and the third Part, such
as may be had out of Minerals. And this also is a primary reason why
I have comprised each kind of Medicaments in a singular Work or
Treatise, because of the envious know-littles, and foolish deriders,
and despisers of Art, who reject all Mineral Medicaments, (but they
know not their properties) as unsafe at all times, because not taken
forsooth out of the wholsome Vegetables, (whose use and virtue
[say they] hath been approved for many Ages) but out of the
poisonous Minerals and Metals, whereto no trust is to be given, and
the use of them too is to this day very rare, and their operation too
vehement. Now that I may stop the mouths of these kind of Men,
and that they may see and know, that I likewise am well versed in
the virtues of Vegetables, and their true preparations, together with
their purification and fundamental Anatomy, and with their reduction
into most wholsome and most safe Medicaments, I have purposed
with my self in my first part of my Spagyrical Dispensatory, to treat
of no other things save onely such Medicaments as are made out of
known Vegetable Simples, without the addition of any other things,
(either Animal or Mineral) as for instance, out of Herbs, Flowers,
Roots, Fruits, and Seeds, their separation by Art, and their reduction
into a better form. In the second part, we will treat of such things
onely as proceed from, and are prepared out of Man, and other
Creatures, and such as live in the Air, and also such as live in the
Waters. But in the third Part I shall not desist from defending those
Medicaments of mine, which I published some years since, and were
prepared of Minerals, and shall demonstrate unto you, that they are
not at any rate to be shunned or neglected, if rightly prepared and
applied, but are to be preferred far before those Medicaments that
are prepared out of Vegetables and Animals. To them I will also
adjoyn the use and preparations of several other things, which I
never as yet made mention of. Nor do I doubt but that the eyes of
the blind will sometime or other be opened, so as to see the truth,
and confess it and love it, to the doing whereof, I pray God, that
Eternal, Immutable, and durable Light, the Father and defender of
the truth to help us. Amen.

THE

SPAGYRICAL PHARMACOPOEA:
OR

D I S P E N S A T O R Y.
What Vegetables are, or what is meant by the name of Vegetables?
ou are in the first place to note, that under the name Vegetable,
comes all that which hath its Food out of the Earth, which grows or
Y
is encreased, be they Herbs, Shrubs, or tall Trees with what
appertains unto them, as the Root, Stalk, Leaves, Flowers,
Seeds, and Fruits of them, as well cultivated as wild, both of
our own Countrey, and Forreign, as well the known wholsomes one,
as the unknown and hurtfull, whatsoever name they are called by,
the kinds, shape, form, property, virtue, and power; of which, may
be found described by many ancient and later Philosophers and
Physicians, so that ’tis needless to make any farther rehearsal of
them.
My purpose is onely to tell by what means, and by what most
excelling way that innate virtue, operation, and efficacy, which God
hath implanted into them, may, and indeed ought, by the dexterity
and industry of Man, to be separated from their dead Fæces and
Husks, and be concentrated and applied in a convenient form to
Diseases, and be reduced into a most pleasant and acceptable
Essence. But some may object and say, what good is here in
bestowing such a deal of labour and care to extract the virtues out
of Herbs, and concentrate them, and so at last administer them to
the Sick? Will it not be all one, if any one know their natures, virtues
and properties, (the which may abundantly enough be known by the
large description given of them, in the Books both of the Ancient and
Modern Physicians) and so make use of them, green and dryed,
according as they are at hand, or else first steep them in Wine, Ale,
Water, or any other drink used at Meals, or else boil them therein, or
omit the decoction, and drink the infusion, and so administer help.
Will not that perform the very same effect, that the well prepared,
pure, subtile, sweet, and efficacious essence will? I answer that
without question, there is extracted some kind of virtue out of the
Herbs, by such a kind of infusion in Wine, Ale, or such other like
drinks, and is together with the Wine carried into the Body, and
effects no small things, if it meets not with too much matter that is
to be turned out. But yet no body will deny but that their virtues
being extracted and concentrated, and taken in a spoonfull of Wine
or Ale, will operate more speedily, and be taken in more pleasantly,
and display its virtues more effectually than the boiled Herbs, or its
infusion; wherein by reason of the virtue of some few drops as it
were lying hid in a whole handfull of Herbs, we are constrained to
drink down together herewith such a deal of Wine or Ale, which too
is rendred very unpleasant and ungratefull by the Herbs: This the
Ancient Physicians well observed, and made an accurate search
many Ages ago, by what means they might best of all prepare Herbs
sundry ways, so as to be taken inwardly with delight, and be
encreased in their virtues. Thence it came to pass that so many
preparations are brought into the Dispensatories, which abide in use
even to this very day: amongst which there are distilled Waters, Oils,
Balsoms, Ointments, Juices, Electuaries, Conserves, and such like;
the which I do not by any means reject, but onely mention how the
virtues of Herbs may be administred to the Sick, in a far more
pleasant form. It is all one to me, if the aforesaid and usual
preparation of Herbs be still in best repute and so continue, for I
neither sow there, nor expect to reap thence. And should I need
their help (which God forbid) and that I had no better to supply my
necessity, I would give God thanks, for his vouchsafing me a part of
those prepared Herbs, lest I be constrained to make use of raw
Herbs, in that manner that the Cows eat grass, but yet that I have
better, no Body can blame me, if I rather use them, and am willing
to communicate them out of love and duty to my Neighbour. Verily
no Body is compelled to do otherwise than as pleaseth him, one
useth Herbs in an infusion of Wine, another eats them with Vinegar,
Salt, and Oil, another takes them green as they are, and cuts them
small, mixeth them with Sugar, and assoon as they are come to a
dryness, brings them into Powder, and takes them in some Broth;
Another may thicken them with Honey, and Sugar, squeeze them in
a Press, and so use them. And plainly ’tis no matter what way a Man
takes in using them. Some there are that can’t abide any Powders,
because they stick to their Gullet and will not pass down into the
Stomach, others can’t endure Pills, and some you will meet with to
whom all sweet things as Honey and Sugar are distastfull. And you
will find many too that can’t endure Wine or Ale, wherein Herbs have
been steeped but all night. Upon this account venerable Antiquity
considered of so many preparations of Herbs, that if haply one way
did not like them in administring them, the Physician might make
use of another way, and so Men did year after year attempt more
and more the preparation of sweet Medicaments, and so trimmed
and adorned their Pharmacopœa’s daily by little and little, and
brought it to a better state: And that is thus evident (I will now
speak onely of the Vegetables,) viz. there are to be found almost in
all well constituted Pharmacopœa’s, burning Spirits, which are
produced (by distillation) out of fermented Herbs, as likewise Salts,
which are extracted out of calcined Herbs and again coagulated; also
extracts, and (by the mediation of the Spirit of Wine) thickned Juices
are extracted; also distilled Oils, and some coagulated into Balsoms.
And many more preparations of this kind, and better sorts there are,
which have not been of any very long standing, but have been by
little and little added by good and faithfull Physicians, all which
things do perform as much as they ought (or may be expected in
the rank in which they are) nor ought any one to throw them clear
off. But now if any one knows how ingeniously to extract the virtue
of an Herb, and to concentrate it in such a manner, as that one
onely drop shall be of as much efficacy as a whole cupfull of distilled
Water, or as a spoonfull of Powder, Juice, Syrrup, or Conserve. Why I
pray, should not one drop be in all likelyhood more willingly taken
than a full Cup, or a spoonfull? That which may be done by a few,
needs not be done by a great many. But haply some other will say,
how can I be certain that there is a greater virtue in some drops of
some good Essence, than in a whole spoonfull of dryed and finely
powdered Herbs, or of green Herbs condited and beaten with Sugar,
or than a Potfull of distilled waters; now this may be known by the
virtue, odour, and tast, and that on this wise. If a few drops be put
into a potfull of pure fountain water, and be stirred with a Spatula,
the said water doth then exactly resemble the odour of the Herb
when whole, and doth as to its tast agree with that water which is
drawn out of the green Herb by distillation. If therefore the odour
and tast be there, the virtue cannot be far off, besides the use will
easily shew it, if both of them are in the proof compared together.
And this now cannot be contradicted by any probable argument, for
it is clearly evident to every one, that such a kind of Essence is an
hundred thousand times more efficacious (respect being had to the
quality and quantity of the same) than the Herb either green or
dryed: Besides there also ariseth this benefit, that such a kind of
Essence doth not at all lose any thing of its virtues though kept a
great many years, whereas the other preparations and especially the
distilled waters will grow musty and putrifie. But an Essence will (if
warily preserved) endure as efficacious above ten, yea an hundred
years, as it was the very first day that it was made. Forasmuch
therefore as these things are without controversie thus, we should
rather mind the chusing of such things which being but small in
quantity, are pleasanter and more efficacious than those that are of
so great a bulk, which indeed are of little or no efficacy at all. There
is no body will deny, but that the virtues of Herbs are widely
dispersed and hidden in themselves, and for which virtues sake we
are forced to take the whole Herb, that is, the dead body for that
little virtue that lies hidden therein, just as if a Man instead of Bread
should eat the crude wheat together with the stalk whereon it
grows, which certainly would prove very hurtfull to the Stomach, and
would together with its allaying our hunger corrupt the Stomach,
and make it unfit for digestion. If therefore the Countrey-men who
are the most sluggish and unaptest Men of all others, have by a long
course of time arrived unto and experimented this Wisedom and
Dexterity, viz. that the Corn is not just as it comes out of the ground
in its husk and stalk, at all fit for the use of Man, and do likewise
well know that it is far more profitable (if the grain be first threshed
out of the Eare, then ground small in a Mill, the husky Bran be
separated, and then the pure Meal mixed with a little water and Salt,
or ferment Leaven, and so the Past suffered to ferment, and
afterwards be baked) than to use the crude Corn just as it grows,
why should we not use also the utmost of our endeavours to extract
the most pure Essence out of medical Herbs, and so to administer
them to the Sick; than to use the crude Herb as it comes out of the
Earth? And this I instance onely for example sake, that it may
appear that a legitimal preparation exalteth a thing into a far better
state than it was before. And this may be demonstrated by sundry
examples, if need required, but sure here is no body that is such an
unwise Tatler as to dare to oppose it. Forasmuch then as the case
stands thus, that an extracted, pure, and subtile Medicine, operates
far more speedily and safely, than when prepared after the common
manner, I judge it much amiss to conceal the way that leadeth
thereunto, and not to give directions for the use and profit of ones
Neighbour. Nor indeed can I say that this invention of preparing
Essences of Herbs did proceed first of all from my self; for ’tis
unknown to me what another may either have done, or is able to do.
But this I know, that no body hath hitherto mentioned the same
either in Writings or otherwise, and that this preparation is no where
known or in use. Well be it as it will, whether or no others know it as
well as I, or have known it before me, yet it ought to be accompted
a good thing, that I bring it forth to light for the sake of so many
sick People. And it would have been much more acceptable unto me,
if any body else had published it before me, and had eased me of
this labour. But that I may return to my purpose; I will begin a brief
but very clear description of the way whereby the virtue of Herbs is
to be extracted and concentrated, that so by this means they may
be more effectually operative in Diseases, and be more
commodiously administred than the crude and unprepared Herb, and
it is to be done as followeth.

The Preparation of the Essences of Vegetables.

T ake of an Herb cleansed from the Earth, and its withered and
putrified Leaves, both Root, Stalk, Leaves, Seed if they may be
had, as much as you list, but however let it be at the least some fifty
pounds weight, for the Fermentation will not succeed so well in a
lesser quantity, as if taken in a due measure and plenty. Cut the
Herb, &c. small, pour Water hereupon as much as is sufficient to fill
your Copper Still, within an hands breadth of the top, urge your fire
somewhat strong, and there will distill forth a clear and well smelling
Water, together with a little Oil, which you must separate from the
Water by a tritory or separating glass, and reserve it apart: then take
out the Herbs remaining in the Still, put more of your Herbs in, and
distil the Water and Oil as before, this repeat so long, until you have
distilled all the Herbs, always separating the Oil from the Water, and
keeping it apart. Now then all the Herbs being thus distilled, pour
water on them again, and put thereto a spoonfull of good new Ale
yeast, and let them ferment together in a woodden Vessel covered
over for some three or four Days: Then when the Herb begins to
leave off working, ’tis enough, and is fitted to send forth in a volatile
manner by distillation its most pure parts, viz. Salt and Sulphur. Stir
the matter well with a stick, that so both thick and thin may be well
mixed together; fill your Still herewithal, give a fire by degrees, that
the Herbs burn not too, and the Spirit tast of an Empyreume. Distill
it with a Refrigatory so long as the water hath any savour, the which
you may easily find by tasting it often, when the water comes forth
insipid cease from the Distillation, keep what is distilled forth in
glasses: Then empty your Still and fill it again with more fermented
Herbs, even within an hands breadth of the top, distil thence the
Spirit, the which so long repeat until there remains nothing of the
Herb undistilled. Then having cleaned the Still and Refrigatory, pour
hereinto all your distilled Spirits, and rectifie them, take onely the
strong Spirits, pour out the insipid water left in the Still; rectifie the
Spirit again in an Alembick in B. M. and it will again put off an insipid
water; and if need be repeat this rectification yet once more in a
glass Alembick, that so the Spirit being exalted by a farther
operation may become very strong and subtil, and its internal Vertue
may be concentrated. So then, now take the Herb from which the Oil
and Spirits proceeded, make thereof small Balls which dry in the Sun
or at the Fire, burn them unto Ashes, from which Ashes extract the
Salt with the insipid water left in rectifying your Spirit, and coagulate
it: This Salt you must again dissolve with more new water and filter,
and coagulate it and then it is enough. To one part of this Salt, pour
two parts of the rectified Spirit, and gently abstract it in a B. M. and
so the Spirit will receive into it self asmuch as it needeth of the fixed
Salt, and bring it over with it self by the Alembick: But the fixed Salt
holds back the Phlegm, which as yet lurked in the Spirit. But now the
Salt thus moist, if it be again fired (or calcined) is as good as it was
before. To this Spirit thus concentrated even to the utmost, pour an
half or a third part of the Oil you distilled before out of the said
Herb, mix them together by shaking them well, and the
concentrated and Alkalizated Spirit will in a moment devour his said
proper Oil, and will all of it be converted into a clear efficacious and
pleasant Essence. In which Essence the volatile Salt and Sulphur of
that Herb are united with the fixed Salt, and are to be accompted of,
as a pleasant, penetrative, efficacious Essence, and friendly to
nature; the which may be mixed and profitably taken with any
Liquor: A few drops of which have more Vertue than a whole
handfull of the crude Herb. And this Essence being taken into the
Body, doth not onely operate more efficaciously in those kinds of
Diseases which the Herb served for before its being thus prepared,
but doth also (by reason of its subtil purity) more speedily display its
Vertues, and being externally applied, doth (by its Odour)
corroborate the Heart and Brain beyond all other, how sweet and
odoriferous soever thickened Oils, prepared with Civet, Musk and
Ambergrese; all which it compared with this Essence, are to be
esteemed of as a dead Body: For in this Essence, the volatile Salt
which is conjoyned with the Oil, doth presently introduce (or lead it
inwards) and make it subtil, even to Admiration. And so this
Medicine serves as well for inward, as for outward Uses. And certain
it is, that the sweet Odour of any Herb, such an one as by which the
Heart might be comforted, as it were in a moment, doth sometimes
effect more than another comforting Medicine taken into the Body.
For the Heart of a Man lives of the Air, as a Fish doth in the Water,
the which being pure, the Heart becomes also well thereby, and so
on the contrary ill. Why should a Man love to smell a Flower, did not
the sweet Odour comfort his Heart and Brain, and were not his
Spirits refreshed thereby. If then the Flower and Herb effecteth thus
much, where the sweet and comforting Spirits are as yet
encompassed, involved, wildly diffused, and tied to their dead Body;
what will the Spirit do, being separated from the Body, highly
depurated and again concentrated. Besides the daily, and (to all)
well known experience, that a pleasant Air refresheth the Heart, but
a corrupt and infected Air (as is evident in the time of the Plague)
doth (on the other hand) debilitate it, and plainly suffocate it; It
might be an easie matter to produce Histories to prove and verifie
the same, but that it would be too tedious. But yet I must needs set
down here one or two memorable ones, for the better confirmations
sake of my Opinion. Josephus de Acosta an acute and very expert
Philosopher, of the Order of the Jesuits, wrote a Book of the
Condition and Property of the Isles of the West Indies newly found
out, and amongst other things in the third Book, and ninth Chapter,
speaks of things no less incredible than true, concerning the nature
of some Winds which (in some Provinces scituate beyond Chili) leap
down as it were from the Tops of Mountains and Desarts, and saith
of them, that these Winds, do (by reason of the notable piercing
cold) not onely cast or throw down for dead, the Passengers passing
that way, who not dreaming of any such thing are not well provided
against it, but doth also wholly kill some meerly from that most
subtile Cold, so contrary and extremely inimicitious to the Spirits and
Life of Man. For even as a pleasant and temperate Air doth preserve
and cherish our vital Spirit, and nourisheth it; so on the contrary an
intemperate and cold Air, doth suffocate and kill it: The which thing
is wont to happen to such as sail at Sea, for there the Air is infected
by the motion of the salt Sea, and doth so affect and debilitate those
that are unaccustomed thereunto, and especially their Brain, Heart,
and Ventricle (as we said above concerning the cold Wind, in the
Desarts about Chili) that it causeth men to vomit, their Head and
Heart pains them, they loath both Meat and Drink, until they are
accustomed to the Air, and can well brook it. Besides this story I will
yet add another, to shew that an infected Air can bring more
detriment to the life of a man, than any corporal Poyson. For a
corporal Poyson invades the stomach onely, which by the help of
Nature doth easily expel the same again, which is sufficiently
witnessed by all well known Histories, viz. that a man casts out by
vomit a Poyson that is drunk down inwardly, but that spiritual
Poysons do hasten to the Heart, to suffocate the vital Spirit, unless a
man be well armed, and this shall be instanced unto you by the
following History.
About some 30 years ago, there were two Mountebanks at Paris,
that had their stations not much distant from one another, and they
did each of them to their utmost commend their own Treacle which
they sold to the Inhabitants, thereby to disparage each other, and
each to allure the men to himself onely. But at last they came to a
bargain betwixt themselves, which was this, each of them should
defend himself with his own Treacle, against the Poyson the one
should give unto the other, and thereby defend the excellency of his
Medicine. Well, one of them takes a huge Toad, swallows down one
half, gives the other half to his Companion to devour, the which he
also swallowed and neither of them hurt. The next day following, the
other invites his Adversary and used this Stratagem. He took a Viper,
together with a Toad and put them into a Drum, adding hereto an
handfull of Salt, and ordered the Drum to be beaten a while with
Drum-sticks, with which unwonted noise both the Serpent and Toad
being enraged, breathed forth their spiritual Venome, and filled all
the Drum herewith: This done, he bid his guest put his nose to the
hole of the Drum, which is usually about the middle of it, for the
letting forth of the sound, who as soon as ever he had drawn in the
spiritual Venome, fell backwards and died presently, not dreaming
any such matter, nor understanding that the spirits either good or
bad have as effectual operation upon the body, as a corporal Poyson
hath.
I have not inserted these two stories, to fill the Paper up with
words, but to shew, that Spirits being separated and freed from their
bodies, are in there virtue and operation an hundred times stronger
than the bodies themselves are, though conjoined with their Spirits.
The which thing doth as well take place in such subjects that are
wholsome and friendly to Man’s nature, as in these here rehearsed.
It is abundantly known how many good and subtile Spirits I have
described for the sake of the Sick, in my second part of Philosophical
Furnaces; yet few are here to be found that set about the
preparation of them. Amongst which Spirits, that of Sal Armoniack is
not the meanest, which because of its penetrating and temperate
heat, doth exhibit a most present operation, and is a Spirit worth all
Men’s knowledge, and worthy every where to be had at the
Apothecaries Shops. Yet I have not as yet seen it any where to be
had, though I described a short easie way of preparing of it: But of
this (if God will) more shall be spoken in the next part, where we
treat of such Medicaments as are prepared out of Animals. Such as
are their volatile Salts, and fixed ones, wherein a great virtue lieth
hidden, and are (in some cases) to be far preferred before those
Medicaments that are made out of Vegetables. But yet though it be
thus, I cannot but admonish here that good and subtile Medicines
are to be circumspectly used, and not to be administred to the Sick
in a greater quantity than their nature will bear. Good and sound
Wine is able to comfort, and conserve in health, the Heart, Brain,
and whole Body of him that useth it aright. Whereas another that
useth it immoderately, even the same Wine is able to inflame and
infect his Lungs and Liver, to possess his Head, to bring a trembling
into his Hands, and a Gout into his Feet, to weaken his Sight, and to
fill his Reins and Bladder with the Stone; and for this end it was
never given by God, nor gotten with so much labour, but was
created onely to serve for the health of Man. O what curious secrets
do lie hidden in the Wine onely (not to speak of Corn and other
Fruits) all which the World neither knows nor cares to know, and I
have determined with my self to publish, in my Vegetable Work, but
yet it is at the pleasure of God, whether he will permit so to do or
not. It is sufficiently manifest by Wine alone, that the abuse of a
thing hurts not the abused subject, and the same may be said of
other penetrating Medicines, whose operation is according as you
use them. We do not suffer a Child or a Fool, neither of which are
compos mentis, to meddle with a sharp Knife, for fear lest they
should hurt both themselves and others too; but now a Wise Man
useth it aright, and knows how to employ it both to his own and the
use of other Men. If then one hurts another with a Knife, the fault
lies not in the Smith that made it, because he gave it such a keen
edge, but in him rather that used it amiss.
Thus much I judged it worth the while to advise you of, lest haply
some of the Essences which I have described, should undergo a
wrong censure, as if they were too hot, but if they should, it may be
known what answer to give. For I confess that too much heat doth

You might also like