Snippets

CJSH.name/snippets

Snippets is a CGI script where fortune cookie meets wiki. It provides:

  • A way for people to share quotes, recipes, jokes…
  • A private niche where a person can keep track of sites to visit, people to e-mail.
  • A tool for administrators to turn a large repository of static content into a manageable amount of dynamic content.

Snippets is designed to be easy to configure and customize.

The present release is version 1.0b.

License: This project is free software, available under your choice of the Artistic, GPL, and MIT licenses. If you like this software, you are invited to consider linking to CJSHayward.com.

 

Version Unix/Linux
1.0 (stable) Download
1.0b (experimental) Download

Please e-mail me if you are interested in porting Snippets to another server platform.

CJSH, a Python 3 based experimental, programmable Linux / Unix / Mac command line shell

Proportional font terminal: a better Linux / Unix / Mac term

Private logistics: privacy-sensitive todo, calendar, scratchpad, personal information management (PIM)

The Spectacles

The Minstrel’s Song: A Simple Mathematical Model

CJSH.name/simple

Read it on Kindle: part of the collection, The Minstrel’s Song

After having made an exquisitely complex mathematical model, I am trying to make something simple that will take a back seat to role play, and not confuse new players. It is modelled after White Wolf, and in another sense after the computer language Smalltalk; I am trying to make a rule sheet that is very short and sweet.

In this model, you have four attributes: Physical, Mental, Social, and Other. Each of those attributes is rated 1 to 5: 1 is below average, 2 is normal, 3 is typical for adventurers, and 5 is highest possible. The value of these attributes is determined by you and the game master, at whatever most appropriately represents your character. The Other attribute is one you specify: could be charisma, or understanding of other people, or dexterity, or knowledge. It should be chosen in an area that tells more about your character than just Physical, Mental, and Social would have. You also have skills/abilities, each rated at between 0 and 5; skills can be anything appropriate; a suggested list is as follows:

Acrobatics/Tumbling, Acting, Animal Handling, Animal Training, Anatomy, Anthropology, Appraisal, Artistic Ability, Attack, Balance, Biology, Blacksmith, Blind Action, Bowyer/Fletcher, Brewing, Building, Carving, Carpentry, Catch, Ceremonies, Charioteering, Chemistry, Climbing, Clockwork Device Craftsmanship/Engineering, Cobbling, Cooking, Cold Tolerance, Cultures, Dancing, Dodge, Endurance, Engineering, Etiquette, Farmer, Fencing, Fire-Building, Fisher, Gambling, Gardening, Geography, Guess Actions, Haggling, Hear Noises, Heat Tolerance, Heraldry, Herbalism, Hide, History, Hunting, Illusionism, Improvisation, Incense, Janra-Ball, Jewelry, Juggling, Jumping, Jury-Rigging, Languages, Leadership, Leatherworking, Literature, Mapmaking, Massage, Mathematics, Mediation, Medicine, Mining, Move, Musical Composition, Musical Instruments, Navigation, Open Locks, Persuasion, Philosophy, Physics, Poetry, Pole Vaulting, Pottery, Public Speaking, Pyrotechnics, Reading/Writing, Read Emotion, Repair, Riding, Rope Handling, Sailing, Search, Shouting, Singing, Smell Creature, Sports, Stonemasonry, Storytelling, Strategy Games, Swimming, Symbolic Lore, Tactics, Tailoring, Technology, Technology, Theology, Throw, Tightrope Walking, Tracking, Trivia, Ventriloquism, Weather Sense, Weaving, Wilderness Survival, Withdrawing, Woodlore, Wrestling

You start with a total of 10 points to distribute between all your skills; you will earn from 1 to 3 experience points between sessions, depending on how well you role play. It takes 1 experience point to raise a skill from 0 to 1 points, 2 experience points to raise a skill from 1 to 2 points, and so on, 5 points being necessary to raise a skill from 4 to 5 points.

When you attempt to do something, the game master will assess a difficulty level from 1 (easiest) up to 10 (most difficult). You will add up the relevant attribute plus skill level (-1 if you have no skill points for that skill), and then add a die roll (divided by 2 and rounded down) to your sum, making your total; the game master will add a die roll (divided by 2 and rounded down) to the difficulty, making the difficulty total. If your total is greater than or equal to the difficulty total, you succeed at the action.

Injury is intentionally left out of this model. It is intended to be role played — if you fall when climbing the wall, the consequence is not that you’re three hit points lower; the consequence is that you’ve got a broken leg. The point of this model is not to govern role play; it is to support it, not representing in full so much as evoking just enough chance to lend uncertainty to events in role play.

Espiriticthus: Cultures of a Fantasy World Not Touched by Evil

Stephanos

Two Decisive Moments

Science and Knowledge: Regenerate Science, Philosophia Naturalis, and Human Ways of Knowing

CJSH.name/science

“[Merlin] is the last vestige of an old order in which matter and spirit were, from our point of view, confused. For him, every operation on Nature is a kind of personal contact, like coaxing a child or stroking one’s horse. After him came the modern man to whom Nature is something dead—a machine to be worked, and taken to bits if it won’t work the way he pleases… In a sense Merlin represents what we’ve got to get back to in some different way…”

C.S. Lewis, That Hideous Strength

Is it, then, possible to imagine a new Natural Philosophy, continually conscious that the natural object produced by analysis and abstraction is not reality but only a view, and always correcting the abstraction? I hardly know what I am asking for. I hear rumours that Goethe’s approach to nature deserves fuller consideration — that even Dr Steiner may have seen something that orthodox researchers have missed. The regenerate science which I have in mind would not do even to minerals and vegetables what modern science threatens to do to man himself. When it explained it would not explain away. When it spoke of the parts it would remember the whole. While studying the It it would not lose what Martin Buber calls the Thou-situation. The analogy between the Tao of Man and the instincts of an animal species would mean for it new light cast on the unknown thing, Instinct, by the only known reality of conscience and not a reduction of conscience to the category of Instinct. Its followers would not be free with the words only and merely. In a word, it would conquer Nature without being at the same time conquered by her and buy knowledge at a lower cost than that of life.

Perhaps I am asking impossibilities…

C.S. Lewis, The Abolition of Man

Put this way, Lewis is advancing the possibility of a regenerate science as a speculation, as a call for something that doesn’t yet exist. But in fact a regenerate science does exist, whether “natural philosophy” or not, and this regenerate science is as old as the hills.

Let me quote first lecture material for a friend who is teaching interns about farming:

Learning with your whole body

I’m assuming that most of you have been to college. Even if you haven’t, you’ve been learning for 12 years in an institution that has taught you that learning is done with the brain, that it comes from words written on screens or paper, and that the way you show what you’ve learned is to write intelligent words on screens or paper.

Here is the first thing I need you to understand: out here in the garden, you do not learn with your brain. You learn with your hands and with your eyes and with your whole body. Your brain is involved, sure. But don’t let it take over. Don’t separate “learning” and “working.” Every moment you’re in this teaching garden, and even a lot of the time you’re working in other parts of the farm, if you pay attention you can be learning constantly.

School teaches us to think of learning as information. It’s such a mistake! Yes, there is information that will help you learn to garden, and I’ll teach you some of it—but if you don’t learn it with your body, it won’t be much use to you.

You’re going to need educated eyes—you’re going to need the ability to look at a plant and know if it’s thriving, to look at a little seedling and be able to see in your mind how big it’ll be so you can give it enough space, to look at a patch of weeds and have a sense of how much bigger it’ll be next week if you don’t kill it now. (The most advanced skill, which I’m still learning, is looking at a row of green beans and estimating—from how thick the blossoms & small beans on it are—how much it’s going to produce over the next couple weeks.) You need educated hands—you need to be able to feel, when you’re swinging a hoe, whether you’re really biting into the roots of the weeds, and you need hands that know how to weed fast and effectively, and how to use a pitchfork, etc, etc. And you need instincts, too—when you’ve just transplanted a plant, you need to have the instinct to check on it till it’s established, same as people have the instinct to check on a baby.

And you learn all that by experience. Writing it down won’t help. Doing it while being aware of it is what helps. Be in the moment, don’t be thinking of something else while you work. (Well, maybe when you’re weeding strawberries!) Get your hands in the dirt and feel it, compare it with how it felt last week, watch and observe the plants as they grow—and watch the weeds as they die! Watch how much quicker they die on a sunny or a windy day, watch how they re-root themselves even from a lying-down position if it’s too wet. At some point it all comes together and you start to develop a sort of instinctive understanding of the garden as a natural system. I’ve been doing this for five years now—I knew next to nothing about gardening before that—and I have a sense now of how all the pieces work together, not in theory but what’s happening in real time in my own garden, and it’s such a pleasure. It has been such a pleasure to go from someone who learned things only with her brain, to someone with hands and eyes that understand my garden.

I know some of what I’m saying you may already know, but I still think it’s worth saying at the start here. I’ve just seen so often how hard it is to get rid of the idea that reality is in our heads or on paper and start focusing on the reality that’s under our feet—to stop going on what you think is supposed to happen instead of looking at what really happens. I know it took me a lot longer than it should have. I still remember my breakthrough moment. I was using the push-cultivator—which I’ll teach you how to use—and it was a new tool for us at that point so I didn’t know its capabilites. The thing is that when the weeds get to a certain height, the push-cultivator doesn’t kill them anymore—you have to use a hoe. But I would push the cultivator on down the row and it would kill a few weeds and knock down the rest and cover them with dirt so the row looked clean, and I never noticed that their roots were still in the soil, and in my head I would make a little check mark—well that row’s done. The next week, we’d be looking through the garden to see what needed doing, and there would be a bunch of weeds in that row again, and I’d go, “Wow! They came back fast!” and cultivate again. I still remember the day the little lightbulb came on in my head and I realized I’d never killed those weeds at all. I felt so dumb. That was the day I learned to look at what I was doing. Not just at what I thought I was doing.

And that’s a lot of what is involved in learning a skill—not just knowing “how” but involving your hands and eyes and brain all together in the process, so that you can feel how the motion is working and you can see whether it’s working—and you remember to double-check the next day whether it worked!

Okay, I have one more story. This one taught me so much. We had a temporary volunteer in the garden for three days. He was this guy who, if you told him how to do something, would look annoyed as if you were patronizing him or something. Because, you know, everybody knows how to hoe, right? Well, I got embarrassed by him being offended and figured he was right, maybe it was rude to try and tell someone how to do such simple stuff. I was a beginner too, at the time. Erin told us to hoe a certain section, and we did it. And we did it backwards. We started at the back of the section and walked backwards to the front as we hoed, so that all the plants we hoed up ended up in a pile in the next bit we had to hoe, covering the weeds there. The result was that at the end of our work all you could see was a pile of dead plants, so it looked great, it looked done. And the next day when those dead plants had dried up and withered away, what you could see was a section that looked like someone had hit it a few times here and there with a hoe—at least half of the weeds were still alive and kicking. The next day Erin took me aside and showed me how to hoe for real: you move forward, and you hoe up every inch of the soil, whether you see a plant there or not. And I’ve never felt embarrassed to teach anyone to hoe since then. It’s a skill.

It’s a huge mistake to think of any part of farming as unskilled labor. A skilled worker can weed about five times as fast as a beginner—if not more. Farming is skilled, complicated, grounded work that involves your hands and your eyes and your brain and your whole body—and at some point you may find it starts to involve your heart. You’re learning something this year that you can be proud of.

(Heather Munn)

My friend is part of an intentional community and comes from a more ivy-like background; she as a writer was perhaps able to put into words what would perhaps have been water to a fish and perhaps too much “just the way things are” to readily put into words. Except, perhaps, in discomfort at city types who do skilled labor with computers and are above the unskilled labor in a farm… but wouldn’t eat except for “unskilled” labor at a farm.

Regenerate Science

But I am interested in this passage as a lettered glimpse into a regenerate science that does not do to vegetables what modern science threatens to do to men. It is not exotic: but perhaps it shouldn’t be exotic in the first place. Acting on plants bears no animistic or occult overtones or confusions, but it is quite naturally a personal operation. It is, humbly and naturally, sensitive to an I-Thou that never dissolves away into mere I-It. The regenerate science Lewis calls for is not waiting to be concocted by some genius of a bookworm; it has been around all along and remains (humbly) accessible even to bookworms like my friend.

And this regenerate science is not just the biology that is experientially known to a farmer, although I would be very cautious about too quickly dismissing this instance. True, it is a biology of very specific life and plants and not a biology of all life forms or even all farms everywhere: but it may be an attribute of the regenerate science that one knows what one has direct experience of and not everything, everywhere. That locality is arguably a strength.

But to shift focus slightly: Lewis talks about not doing to stones and plants what modern science threatens to do to man himself. This does not in its focus mean destruction of the same in laboratory conditions: though the twentieth century saw lethal experiments on prisoners and 21st century America does experiments on human embryos destroyed by the use that is made of them. However, Lewis’s point is somewhat more subtle: “When it explained, it would not explain away.” He goes on to raise the question whether science “must always be a [mythical monster, with lethal gaze] basilisk which kills what it sees and only sees by killing.” And the regenerate farming science with the manifesto above does not have a basilisk’s gaze. Even weeds are not reduced to nothingness, or explained away, or reduced to being a thing that one holds in the head. Live weeds may be literally killed and reduced to being dead weeds: but even as dead weeds they are not reduced to being merely the playing out of impersonal, discarnate ideas that really exist only in scientist’s heads. And the practitioner may be very ready to kill weeds, but in a certain sense she seems to love them in knowing them with a love that science does not apply to mankind.

Psychology is what we now have as our effort to take an empirical sciences approach to understanding mankind.

Psychology, a secularized surrogate for theology

My MPhil thesis advisor, Thomas Dixon, wrote Theology, Anti-Theology, and Atheology: From Christian Passions to Secular Emotions. His basic approach was to look at one concrete instance as an example of a broader pattern: theology being replaced by anti-theology which in turn moves to “atheology” (“a naturalistic quasi-theology without God”) which is alienated from theological roots but is more estranged from theology than actively fighting against it. He writes, “The details of empirical science are atheological in the sense that a recipe in a cookery book is atheological—both are, if you like, just ‘untheological.'”

The specific instance he chose was the nineteenth century moving from the Christian understanding of passions and affections, which exist within an ascetical framework and are understood in moral and ascetical terms as features belonging a fundamentally moral landscape in “pneumatology” understood of a department of practical theology rather than secular phenomena studied by psychologists who are just-as-much-scientists-as-people-in-the-so-called-hard-sciences-like-physics, to Darwin’s paper-thin understanding of emotion as discussed in Darwin’s The Expression of Emotions in Man and the Animals, where “emotion” is not in particular about something or part of any particular habit, moving to the atheology of today’s psychological understanding of emotions, where emotions may be about something and may be part of a healthy or unhealthy habit (as, for instance, alcoholism), but emotions are not seen as theological in character (and it is not terribly obvious to those within how one would go about associating emotions with theology). Much prior to the nineteenth century, it is not clear how people would react to or translate a statement like, “Feelings aren’t right. Feelings aren’t wrong. They’re just feelings.”

Dixon, as quoted, says, “The details of empirical science are atheological,” and his primary study in the article cited engages the emotions as developed in the category of psychology in the nineteenth century. Even though his point is intended to be an instance of a broader phenomenon or regularity, Dixon, like a good scholar, guards a narrow, tightly focused thesis for his article instead of a sprawling encyclopedia-length book. Dixon in his supervision of me encouraged me to read a book, Mary Midgley’s Science as Salvation, favored by one of my thesis reviewers (although, it seems, not especially foreign to his own interests). Midgley in the chapter “The Remarkable Masculine Birth of Time” talked about what I would call a macho, domineering rebellion against an older understanding of nature (you know, “Mother Nature”) to be merely cold matter as understood by the Newtonian physics that was heralded through vile, lurid rhetoric and imagery of sexual violence to the woman, Nature. Either Dixon’s actual focus of “from Christian passions to secular emotions in 19th century psychology” or a focus he didn’t take of “from a religious outlook on Mother Nature to cold matter in Newtonian era physics” would be better than an article with a combined thesis of “from a religious outlook on Mother Nature to cold matter in Newtonian era physics and from Christian passions to secular emotions in 19th century psychology,” and Dixon holds on to his narrow, focused thesis and explores it interestingly and well.

The friend who wrote the above manifesto had earlier talked about trying to understand people. She studied literature in college rather than psychology, and there is something significant in that. One bank president commented that he preferred making literature majors because they made the best bank tellers; in other words, literature majors made the best tellers because they were the best at getting inside people’s heads. And better, apparently, than psychology students. Psychologists may claim to be scientists-and-they-are-just-as-much-scientists-as-people-in-the-so-called-hard-sciences-like-physics, but literature in its better moments understands the human person without aping physics—and so much the better. The motive of understanding people is not the only motive one might have for studying literature, but it is an obvious motive, and one of the more important. Not to deify literature departments—they seem to get dumb academic fads thirty years later than everyone else, where the better portion would be simply to abstain—but one of the major currents is a science of understanding the human person, and a science that has some of the attributes of a regenerate science that Lewis seems to expect something very exotic, only to be found in some faroff never-never land. But students of literature who try to understand the human person and fulfill easily half of Lewis’s description of a regenerate science have been right under our noses the whole time, and include C.S. Lewis himself.

The queen of the sciences

Furthermore, theology was once known as the queen of sciences. This did not mean that theologians are scientists; in that sense the claim to be scientists, and especially just-as-much-scientists-as practitioners of some other discipline, is very much a “physics envy” phenomenon. Dorothy Sayers reiterates that theology is a science, meaning for instance that it is the kind of discipline that has a technical vocabulary and it matters if you use the terms correctly. But she makes no envious or wishful claim that theologians are “scientists,” and her usage is somewhat archaic. She does not make the claim, or even seem to betray any particular wish, that theology should be flattered by classifying it with empirical sciences like physics. The older claim that theology is a science should be taken seriously, but with it an understanding that “science” in this usage may be a serious claim, but one tenuously related to whether its bachelor’s and master’s degrees are ‘BS’ and ‘MS’, or ‘BA’ and ‘MA’. The same kind of older usage of “science” is enshrined in the words, “We have it down to a science,” which means “We have mastered some precise technique or skill to approach _______,” and not in particular that it is appropriate subject matter for a scientific journal.

In my mind one of the greatest of sciences is the science of spiritual struggle as articulated in the Philokalia. When I first read it it struck me as strange; then years later I found a book it seemed all I had wanted to read. The best way I can think to explain it is that I liked, and like, books like Oswald Chambers’s My Utmost for His Highest precisely because they contain some of what is concentrated in the Philokalia. Here is the pre-eminent science of sciences; if one looks at the medieval Great Chain of Being of God, Angels, Men, Animals, Plants, Rocks, Nothing, we have the science of God, Angels, and Men. No discipline has a higher ambit, though literature comes closer than some. Physics is the science of Rocks and Nothing; no other discipline has so humble of an ambit. Biology may be appropriately called a hard science and may have an ambit of Animals and Plants, perhaps touching on Men: but I have never read someone flatter himself by saying that people in his discipline are scientists-and-they-are-just-as-much-scientists-as-people-in-the-so-called-hard-sciences-like-biology. The envy is always for physics, and I want to ask, “Don’t you find that just a wee bit embarrassing? Don’t you appreciate an ambit of Men which you rightly study? Do you really want your study of Men to be in the image of physicists’s study of Rocks and Nothing? Is that really how you want to try to mediate prestige to your discipline? Even a biological study of Rotting Excrement, teeming with life, would be a nobler and more elevated ambit than the Rocks and Nothing which physics exquisitely delves into.”

Real Empirical Science

I rarely, perhaps only in this piece, use ‘science’ as including theology, at least outside of a grandfathered special case. The older statement that “theology is a science” says something that was, and is, true. However, today the meaning of the term “science” has shifted, and using the term as including theology is liable to cause confusion outside of a historically literate minority, and I am wary of suggesting that theology is a science when I do not have the luxury of explaining what that means besides the obvious implication that theology is a discipline with mathematical and statistical educated guesses about how the world functions that are tested in practical experiments. And I can and do genuinely believe that the ambit of the Philokalia is the crowning jewel of the queen of the sciences, next to which there is relatively little warrant to call physics “science,” but it would just add confusion to call the Philokalia excellent science without further clarification.

Further muddying the waters are the kind of claim that inspired one alleged theology article in my most concentrated course in feminist theology to say, Theologians are scientists, and they are every bit as much scientists as people in the so-called “hard sciences” like physics. The boilerplate, quoted word for word though without attribution (but also, perhaps, without plagiarism as few critics would seriously maintain that the claim is presented as anyone’s original insight), that practitioners of one’s own discipline are-scientists,-and-they-are-every-bit-as-much-scientists-as-people-in-the-so-called-hard-sciences-like-physics, enough so that in my theology education academic theologians sought to include science to mediate prestige and would do what I would later figure out was presenting a journalistically-written, op-ed style article from “science” pages about psychology and free will as representing genuine “science” (I tried quite in vain to say, “If for whatever reason you want to claim to understand science in your theology, get letters after your name in the sciences, and if you want to include scientific findings, quote something in a peer-reviewed journal and not something op-ed—perhaps not the greatest emotional intelligence on my part and probably more intimidating because I did not make any effort at all to incorporate ponderous grapplings with science, and I did have the letters BS and MS after my name), it is not enough to be a gentleman and a scholar: one must also claim to be a scientist, no matter how much one’s real talents may lie in other directions.

Some scholars, including some historians, attempt to use the term “empirical science” to un-muddy the waters a little. There is a legitimate distinction between the enterprise of empirical science and science-as-worldview; science-as-worldview may be very interesting to study, but it is distinct from the immediate enterprise. Secondly, the term cuts out the various disciplines claiming that they are scientists-and-they-are-just-as-much-scientists-as-people-in-the-hard-sciences-like-physics. It may take a rule of thumb that if the members of a discipline are claiming to be full-fledged scientists, they are outside of what is studied in empirical science. And I might comment that, for all the letters after my name, I’ve never read or heard of a textbook or publication in the hard sciences claiming that its practitioners are scientists at all, let alone that they are not one whit less scientific than physicists. One may encounter quaint books like The Art of Mathematics which place mathematics among the humanities, or one may encounter claims that physics properly includes metaphysics (without the counterbalancing nuance that learning competency in physics as taught today does not now include learning competency in metaphysics). But the shrill insistence that one is not one whit less a scientist than physics is really nowhere to be found. Disciplines that are as much science as physics don’t seem to suffer physics envy. And the use of the term “empirical sciences” whittles a very open-ended term down to the point where it is narrow enough to actually be useful for study.

None the less, I have enough foolhardiness to not only state that the mystical theology of spiritual struggle and growth is not only enough of a science that physics’s claim to be science pales in comparison, but that the mystical theology of spiritual struggle and growth is enough of an empirical science that physics’s claim to be empirical science pales in comparison.

Experiment: A term disconnected from its roots

The term ‘experiment’ comes from the same root as ‘experience’; at the birth of early modern science, at the point where there was real contention between Newtonian and Aristotelian physics, an ‘experiment’ could simply mean doing something straightforward and observing what happened. Aristotelian physics said that heavier items fell faster than light items; Newtonian physics said that things fall basically at the same speed regardless of weight (air friction turns out to account for something, but this is a bit of a side issue). At that point it was practical to test one’s experience, dropping a grape and an orange (or a pebble and a fist-sized rock) at the same time and observing whether they both hit ground at the same rough time or whether the heavier item hit the ground much more quickly. I’m going through the muddy spectacles of popularization of history here, but insofar as people were trying to test Newtonian against Aristotelian physics, there was a live possibility of using ordinary means to conduct an experiment where Newtonian and Aristotelian physics would predict appreciably different outcomes. And there can, in fact, be a first-hand knowing, in continuity with a farmer’s practical biology that is known with the whole person, that a pebble and a larger rock will fall through air at the same speed as far as one can tell with the kinds of equipment easily available at the birth of early modern science.

Something has changed along the way. Experiments now regarded as classic and relatively old physics experiments—I can think of the Millikan oil drop experiment and the Michaelson-Morley experiment, are not, in any sense, matters of interacting with the natural world and observing in a straightforward experiment. I have not seen even a very arrogant physics student look at one of those experiments for the first time and say, “I could have done that.” What these experiments instead represent are like devious hacks in information technology, where someone thinks of a clever way to trick the computer to do something that shouldn’t be possible at all (like programmatically shutting down a computer intended not to allow any programmatic shutdown, by continually overwriting the memory physically closest to a temperature sensor so it would read a false positive overheating and shut down). The classic experiments are no longer about observing whether a grape and an orange fall at the same speed as far as you can tell; they are all devious hacks that trick nature into revealing something about its inner workings that you could not tell. And unless you are very wealthy you cannot do experiments on the sort of equipment private people can own; people do experiments at Fermilab on incredibly delicate atom smashers which are just barely adequate to do what physicists are trying to do. When Albert Einstein’s theory of relativity was accepted, apart from possibly the perihelion of Mercury (when Mercury passes the sun, it appears to accelerate and decelerate because its light is bent by the sun’s gravity), there was a time period of decades between when relativity and its experiments and thought experiments could be practically tried out. The twins paradox was in fact pragmatically tried out, decades after Einstein, when scientists brought an atomic clock, which is still as precise a clock as the human race has managed, on board an airplane, and observed that after flying around there was the predicted clock skew against an atomic clock which had stayed on the ground. But absolutely none of the timekeeping devices in Einstein’s lifetime were nearly delicate enough to allow testing the prediction made in the twins paradox. And today there is a somewhat similar position with superstring theory: there is no way that has been projected with today’s technology and resources to do an experiment where the differences between what superstring theory predicts, and what older models in physics predict, are anywhere near big enough to measure. Some experiments have been imagined, but they would require, for instance, more energy than has ever been produced in the history of the human race.

I am probably going on even more shaky ground by suggesting that the term ‘experiment’ no longer applies to significant physics experiments, but I think I can say that the link between experiment in the sense of a physics experiment, and experience in the sense of, for instance, my friend’s knowledge of farming biology, is historical, etymological, and not live. Saying that an ‘experiment’ is something you ‘experience’ is like saying in U.S. English that someone who never drinks alcohol consumes ‘liquors’ all the time, as ‘liquor’, historically at least, can mean a broth that food is steeped with. There may have been a time when people saw ‘liquor’ as more elastic and naturally including both chicken broth and today’s Jack Daniel’s; but now one is apt to get confusion if one speaks of a teatotaller consuming liquor. And in the same sense the historical link between ‘experiment’ and ‘experience’ has been all but severed; precisely none of my friend’s summons to experience practical farm biology is an ‘experiment’ in the sense of the physics experiments I have mentioned, and conversely, precisely none of the modern physics experiments covered in my education constitute a way to have the knowing that drinks. We’re really talking apples and oranges.

For these reasons, mystical theology is empirical in ways that physics hardly touches. Now I should give one caveat, under teaching as a persuasive activity, that at my high school some of the first experiments were intended to dislodge what might be called “innate believed physics” after science education findings had found that it takes a certain number of contrary experimental findings to kill a student’s assumed physics. And I remember that I had an “innate believed physics” and I did not want to let it go. So the physics experiments that set the stage, so to speak, were chosen to give mystical, whole-person knowledge rather than simply convey ideas. But that is at least a somewhat provocative position to take in education, and it was used only at the beginning, simply because even the introductory physics class needed to go much further than experiential “experiments” would show. Such experiments can create trust in the physics being taught; but they can only teach so much of what was really intended to be a class that went far. And the further the class really pushed into interesting physics, the less it built on direct student experience. Now, of course, there were experiences of some stripe. One manipulated things used in the experiments, and read measuring instruments, and analyzed the results, and returned to class. All of this is an experience of some sort, class lectures and tests as much of the labs. But it was not knowledge arising from contact; the experience of reading a measuring instrument was irrelevant to what was being learned, and a teacher who asked, “How’s your experiment going?” to a student reading out an LED display would probably not be happy with an answer of, “There are LED digits that are red, as opposed to green, or dark digits on a silver background, and the background is dark, and they flicker a bit when they change. It looks kind of 80’s. Also, the top LED is a bit dim, and there’s a dent in the left side. Also, the battery might be starting to go dead.” A teacher in the classes wants the student to see past the experience to whatever point of physics was being addressed; the farmer’s practical biology knows by seeing through the experience.

By contrast, the knowing of regenerate science, pre-eminently present in the Philokalia, knows by participating, by drinking, by experience, and knows with the whole person. The farming manifesto of this knowing may speak of knowing with the whole body, and get around to knowing with the heart, while the Philokalia may deal with the heart front and center, although its most concentrated attention to the spirit always, always includes the body. But they are two parts of the same organism, and the knowing in one and the other is empirical in the deepest sense, whereas by comparison, physics is knowledge by hearsay. In physics, even if what you know from your own experiments is experienced or empirical in the proper sense—a point which I am slightly reluctant to grant except perhaps for the sake of argument—a very large portion of your bearings are from the authority of other scientists. The physical theories one works with may be the best provisional educated guess as tested by the scientific enterprise, but the picture I was told of science being distrustful of authority, and mentioning two high school students correcting a calculation by ?Newton? and being accepted in that, is dodgy at best. In both theology and physics there is a great deal that is accepted on authority, but the amount of theology that one knows with one’s whole person greatly exceeds the amount of physics one has by oneself corroborated through experiment, whereby the knowing of theology greatly eclipses that of physics, and furthermore the kind of knowing between the whole person and experiments one has performed is one where the knowing of theology eclipses that of physics. Theologians can say that the sin of an idle word is in anything one says that one has not learned with one’s whole person: woe to the physicist who says (even by analogy) that believing what one has not corroborated by one’s own personal experiments is simply forbidden.

Knowledge is intimate: Understanding feminism

I have another friend, Heather’s brother Robin, who in every other context but one has shown good character and in communication been entirely honest and straightforward. My earliest memories of feminism were of having a sense that it was necessary for Christians to agree with. Later, at one point after some drifting and still assuming feminism was largely true, I was squarely sitting on the fence regarding egalitarianism, he came back from an extended visit with a male relative, and began a rather vile argument that stated in heavily loaded language that we should believe that passages in Paul that feminists like should mean as much as possible what a feminist would mean by them, and passages which the same feminists found inconvenient were problems that should presumably be dealt with as problems. And I replied, in essence, “Whoa. Wait a minute. That’s loaded language… Why don’t you repeat what you just said with the language loaded in the opposite direction?”

Later on I would go to write my first little dissertation in theology as Dark Patterns / Anti-patterns and Cultural Context Study of Scriptural Texts: A Case Study in Craig Keener’s Paul, Women, and Wives: Marriage and Women’s Ministry in the Letters of Paul. My advisor, who was enough of an egalitarian to be a plenary speaker at a Christians for Biblical Equality conference, advised me to compare Keener’s text, chosen as an example of highly inappropriate persuasion, with a feminist / egalitarian treatment that did not pull dirty tricks. The suggestion was wise enough, but both of us searched through Tyndale House in Cambridge’s quite literally world-class library on the subject of New Testament Christianity in the Graeco-Roman world, and neither of us could find anything in a passel of feminist texts that didn’t pull dirty tricks (though I found one properly feminist treatment that was a little less forceful in shady communication). The closest thing I found to what my advisor suggested was a bit of an outlier of a commentary written by a postmodern, secular Jew who commented on the New Testament text but did not have even the pretension of receiving it as authority or Scripture.

My reason for mentioning that is this. All participants in the conversation, across the board, try to present their case in as powerful a fashion and as compelling a light as they can. This goes for conservatives, moderates, liberals, radicals, monotheists, polytheists, atheists, agnostics, and includes Yours Truly. And if egalitarians and feminists consistently and repeatedly communicate in a treacherous fashion, it may well turn out to be a message that goes flat if it is communicated on its merits in a straightforward fashion. I do not say that feminism cannot be communicated without manipulating the audience: but I do say that I have searched for years and not found examples of feminism communicating without manipulating the audience. And I am concerned, less for the immediate affront of an honest and straightforward friend suddenly communicating in a treacherous manner, than a red flag for “What kind of thing, really, is feminism if people only persuade others of it via vile, shady, manipulative communication?

But that is at best the outer shell of the knowledge I have gained of feminism; it is an intimate knowledge, a knowledge of the heart, a knowledge of the whole person. It goes beyond logical speculations of what feminism must be if it communicates as it does. And this heart has everything to do, for instance, with feminist fairy tales, on which point I realized that I did not realize how wholesome and true traditional fairy tales were until I had grasped feminist fairy tales, from the time when a group of college students who read children’s books aloud chose Patricia C. Wade’s Dealing with Dragons, a feminist fairy tale that like other feminist fairy tales is based on the realization that girls cannot be cured of wanting fairy tales, and so provide something with the external ornaments of a fairy tale that wages all-out war on what is right with fairy tales (Dealing with Dragons says, in a well-chosen dust jacket quote, something like “Once upon a time, there was a bad princess,” which is at the heart of what the book delivers). I was moved to strong nausea when I tried to accept that that was what the group was reading next. Again, knowledge of the whole person. I do not say knowledge is primarily a matter of what you feel, or that it always or even often causes one to feel XYZ intensely. But I do say that this is within how whole-person knowledge can express itself at something that warped.

C.S. Lewis opened The Abolition of Man with an exposé of something highly problematic placed in a children’s textbook to educate children; this serves as a springboard which launches into a broad-scale argument about morality, society, and efforts to engineer the abolition of man. However, it is significant that the concrete springboard Lewis chose was the materials society chooses to educate and inculturate children: the hand that propagandizes the cradle is the hand that rules the world.

In that sense, I watched Frozen at a friend’s house (the second time through I sat through the whole thing), and saw tradition unravelling in Disney just a little bit more. I noticed with some distance the standard, formulaic, codependent version of fairy-tale love: it can and does happen that there will be a roomful of people of which the vast majority are emotionally healthy and two are codependent, and the two codependent people’s eyes meet from across the room and they fall head over heels in infatuation and are convinced they have both found True Love and enter a relationship in which both are suffering mightily and struggling to breathe. And, perhaps showing my insularity, I don’t remember too many examples of Hollywood films, certainly not children’s films, where a man and a woman make friends and slowly realize that they want more than friendship. Now I do believe that years of love in a family represent something much deeper than instantaneous infatuation, that infatuation doesn’t last even in a blissfully happy marriage, and I believe various other things, but in Disney’s Frozen all these had the spiritual shape of winning a battle and losing the war. I was left wondering how close on the heels of Frozen will come the Disney version of Brokeback Mountain, and was sure that the first queer fairy tale will be something you have to be a complete heel not to make a little accommodation for—and ones coming after it the claws will come out, the same claws that ended the career of a distinguished open-and-free Mozilla employee after it came out that he had made a donation years back to some cause in favor of defending traditional marriage.

Frozen intruded with a literal level on what is archetypal in fairy tales; the glimpses of the princesses guiltily snarfing a bit of chocolate were A Didactic Lecture In Sensitivity. And Disney used the external shapes of codependent fairy tale romance while subverting them. And on a literal level, a sister’s hold and embrace wrought with deep sorrow is in fact more of true love, classically and analytically speaking, than an infatuated smooch. And could even be felt more, even if that is beside the point. But this is winning a battle and losing the war.

I tried, before my project was shut down by the leadership at Cambridge’s theology department, to write a thesis about the holy kiss as my second master’s thesis. I remember with irritation one point where my advisor, claiming to help me, suggested I narrow my thesis down to the differences between Jewish and Christian understanding of kissing in the Song of Songs. And I was irritated; I wanted to do a doctrinal study of a non-sexual kiss, and not only was his proposed narrowing down of my thesis not a narrowing down of what I had proposed, but it did not overlap what I wanted to research. And then the University decided two thirds of the way through the schoolyear that my thesis topic, which I had declared explicitly at the beginning of the year, did not belong in my philosophy of religion seminar.

Before that thesis got shot down, I read some very interesting scholarship, found out that the holy kiss (“Greet one another with a holy kiss”) was the only act that the Bible calls holy, and found statements like “Examples of the kiss as a means of making or breaking enchantments have been found in the folklore of almost every culture in the Western world.” And what I found about the holy kiss and its cultural contexts only made things stand out in much sharper relief. This isn’t the practice in most of the world now, but the holy kiss was in ancient times a kiss on the mouth, and it is doctrinally significant that the kiss of communion, with which we kiss Christ as well as fellow faithful, is planted on the “gates and doors,” the lips, that receive Christ himself in holy communion. Not specifically that that is what we should do today, but there is something powerfully archetypal in the holy kiss that exists in continuity with fairy tales’ breaking enchantments with a kiss of true love. And Frozen, which is careful not to disturb certain assumptions on the listener’s part (for instance, that their-eyes-meet-across-the-room infatuation is True Love, or that an act of True Love will be a sexual kiss), left me feeling cheated. As much as I cared about the holy kiss as specifically not being sexual, the fitting icon for breaking enchantments in a fairy tale is not a sexual kiss, even though a sexual kiss between the who the prince appeared to be, and the princess, would on a literal level been nowhere near the depth of an embrace of sisters’ love. On a literal level. But not on the archetypal level of fairy tales. And Frozen uproots a couple more pillars of archetypal fairy tale truth by “correcting” it on a literal level.

Sometime later, I wrote:

Barbara’s Tale: The Fairy Prince

Adam looked at his daughter and said, “Barbara, what do you have to share? I can hear you thinking.”

Barbara looked at her father and said, “You know what I’m thinking, Daddy. I’m thinking about the story you made for me, the story about the fairy prince.”

“Why don’t you tell it, Sweetie? You know it as well as I do.”

The child paused a moment, and said, “You tell it, Daddy.”

Here is the tale of the fairy prince.


Long ago and far away, the world was full of wonder. There were fairies in the flowers. People never knew a rift between the ordinary and the magical.

But that was not to last forever. The hearts of men are dark in many ways, and they soon raised their axe against the fairies and all that they stood for. The axe found a way to kill the dryad in a tree but leave the tree still standing—if indeed it was really a tree that was still standing. Thus begun the disenchantment of the entire universe.

Some time in, people realized their mistake. They tried to open their hearts to wonder, and bring the fairies back. They tried to raise the axe against disenchantment—but the axe they were wielding was cursed. You might as well use a sword to bring a dead man to life.

But this story is not about long ago and far away. It is about something that is recent and very near. Strange doings began when the son of the Fairy Queen looked on a world that was dying, where even song and dance and wine were mere spectres of what they had been. And so he disguised himself as a fool, and began to travel in the world of men.

The seeming fool came upon a group of men who were teasing a young woman: not the mirthful, merry teasing of friends, but a teasing of dark and bitter glee. He heard one say, “You are so ugly, you couldn’t pay a man enough to kiss you!” She ran away, weeping.

The prince stood before her and said, “Stop.” And she looked at him, startled.

He said, “Look at me.”

She looked into his eyes, and began to wonder. Her tears stopped.

He said, “Come here.”

She stood, and then began walking.

He said, “Would you like a kiss?”

Tears filled her eyes again.

He gave her his kiss.

She ran away, tears falling like hail from her eyes. Something had happened. Some people said they couldn’t see a single feature in her face that had changed. Others said that she was radiant. Others still said that whatever she had was better than gorgeous.

The prince went along his way, and he came to a very serious philosopher, and talked with him, and talked, and talked. The man said, “Don’t you see? You are cornered. What you are saying is not possible. Do you have any response?”

The prince said, “I do, but it comes not in words, but in an embrace. But you wouldn’t be interested in that, would you?”

For some reason, the man trusted him, and something changed for him too. He still read his books. But he would also dance with children. He would go into the forest, and he did not talk to the animals because he was listening to what the animals had to say.

The prince came upon a businessman, a man of the world with a nice car and a nice house, and after the fairy prince’s kiss the man sold everything and gave it away to the poor. He ate very little, eating the poorest fare he could find, and spent much time in silence, speaking little. One of his old friends said, “You have forsaken your treasures!”

He looked at his friend and said, “Forsaken my treasures? My dearest friend, you do not know the beginning of treasure.”

“You used to have much more than the beginning of treasure.”

“Perhaps, but now I have the greatest treasure of all.”

Sometimes the prince moved deftly. He spoke with a woman in the park, a pain-seared woman who decided to celebrate her fiftieth wedding anniversary—or what would have been the fiftieth anniversary of a long and blissful marriage, if her husband were still alive. She was poor, and had only one bottle of champagne which she had been saving for many years. She had many friends; she was a gracious woman. She invited the fairy prince, and it was only much later that her friends began to wonder that that the one small bottle of champagne had poured so amply for each of them.

The prince did many things, but not everybody liked it. Some people almost saw the prince in the fool. Others saw nothing but a fool. One time he went into a busy shopping mall, and made a crude altar, so people could offer their wares before the Almighty Dollar. When he was asked why, he simply said, “So people can understand the true meaning of Christmas. Some people are still confused and think it’s a religious holiday.” That was not well received.

Not long after, the woman whom he met in the park slept the sleep of angels, and he spoke at her funeral. People cried more than they cried at any other funeral. And their sides hurt. All of this was because they were laughing so hard, and the funny thing was that almost nobody could remember much afterwards. A great many people took offense at this fool. There was only one person who could begin to explain it. A very respected man looked down at a child and said, “Do you really think it is right to laugh so much after what happened to her?” And then, for just a moment, the child said, “He understood that. But if we really understood, laughter wouldn’t be enough.”

There were other things that he did that offended people, and those he offended sought to drive him away. And he returned to his home, the palace of the Fairy Queen.

But he had not really left. The fairy prince’s kiss was no ordinary kiss. It was a magic kiss. When he kissed you, he gave his spirit, his magic, his fairy blood. And the world looks very different when there is fairy blood coursing through your veins. You share the fairy prince’s kiss, and you can pass it on. And that pebble left behind an ever-expanding wave: we have magic, and wonder, and something deeper than either magic or wonder.

And that is how universe was re-enchanted.


Adam looked down at his daughter and said, “There, Sweetie. Have I told the story the way you like it?”

The child said, “Yes, Daddy, you have,” climbed into her father’s lap, and held up her mouth for a kiss.

This story represents a mixed success, and it creaks on a literal level. But it is at least an attempt to be faithful to the archetypal level. And its heavy hand shows what the reader is cheated of in the Act of True Love that Frozen offers.

Winding Down…

There are other things to be said, notably that while feminism claims to promote the good of women—and, more recently, gender studies claims to promote human flourishing—critiques of them are not thereby assaults on the dignity of woman. It may not be obvious how one could be for the good of women, and not for feminist reforms in the name of the good of women, but those thinkers I am in sympathy with are doing a better job of being for the good of women, and the whole human race. “Gender studies” may well pat itself on the back for being the discipline that promotes human flourishing, but it may be closer to the truth to say that the targets of gender studies attacks are usually attacked for something that is part and parcel of human flourishing. And that is true even if feminism arose in response to some genuine deteriorations in Western culture.

Feminism is more than anything else the one force that I personally have worked to critique (see partial list of works to the right), and my knowledge of it is intimate, a knowledge of the whole person. C.S. Lewis described regenerate science as something that while it explained would not explain away, would attend to the It without losing track of what Buber would have called the Thou-situation, would not be free with the words ‘merely’ and ‘only’, and would not reduce minerals and vegetables as modern science threatens to reduce man. I do not believe that my work as regards feminism is what Lewis had in mind when he speculated about a regenerate science, for the simple and boring reason that it is not science, at least not in the sense of empirical science, and I can only see contorted ways of including it under the heading of ‘Natural Philosophy.’ I can quite directly offer my friend’s words about the regenerate science in farming as a candidate for regenerate science; my own work as regards feminism (not necessarily other topics) has the attributes Mr. Lewis would like to see added to Natural Philosophy, but it only strainedly can be forced under the umbrella of Natural Philosophy.

But I submit that my knowledge of feminism is interesting. It has, point for point, all of the things Lewis said he wanted to see in a regenerate science that science, as we now understand it, lacks. And that bears a significance that would not be obvious from saying that the Philokalia represents the science of sciences and has those attributes Lewis projected in asking for a regenerate science. It is not just the knowledge of those things I most admire that have the attributes of a regenerate science. It is also my knowledge of those things I work hardest to critique that is an intimate knowledge affecting the whole person. This is not something that is automatically true or available. One article Lewis wrote, Bulverism from God in the Dock, talks about the fallacy of starting by assuming that your opponent is wrong and then speculating about problems in your opponent’s history that would account for the defect. (Mr. Lewis does not completely exclude investigating an opponents’ background; he only claims that first you have to show that an opponent’s position is wrong through addressing the position itself, and only then may you investigate reasons why your opponent has embraced a false position.) Bulverism is a way of explaining away, and I do not believe that I do it. I may assert that specific feminist claims are wrong, or do not in fact help us, in an attempt to treat them on their merits, and while my arguments are certainly not perfect, they represent a serious attempt to engage feminism on its merits. Perhaps feminists’ personal histories are relevant to the discussion, but I do not recall ever arguing that some detail of feminism is wrong because of some defect that I speculate exists in a feminist’s personal history. I may argue that some aspect of feminism creates a problematic future: but I critique from what is out on the table, in plain view, not from my speculations about what is wrong with feminists’ personal lives. I believe that even in my most serious and concerted critiques there is a personal and intimate knowledge at play, a knowledge that has the attributes that Lewis requests of a regenerate science. This makes the case more strongly that something of regenerate science is present than if it were only demonstrated that my knowledge of things I admire and most seek to emulate has, for instance, what Buber would call a sensitivity to the Thou-situation.

Should “science” dissolve into “knowledge”?

As an undergraduate I enrolled in a “philosophy of science” class that I was in love with from the time I learned about it until the time I read the front matter for a reader with material from classics in the philosophy of science.

What was so off-putting to me is that it said that to say that a study, for instance, was done “scientifically” is a compliment, and go on to state that essentially science and scientific ways of working were standards for excellence in all disciplines, even disciplines that did not have the pretension of being sciences. And while I was very enthusiastic to learn about science as one domain of excellence alongside other ways of excellence, I was dismayed to read a text that established science as the paradigm example of excellence in any discipline.

The conception, cultural placement, and status of science we have is problematic. Sciences are today’s prestige disciplines; but they are a way of knowing what is lowest on the Chain: Animals, Plants, Rocks, and Nothing. The idea that empirical sciences should be the most exalted and enviable disciplines is a bit like having a culture where dieticians mostly know the relative merits of eating Doritos, Velveeta, and microwave pizza, and do not really have much to say about avoiding most processed food, let alone eating Paleo. “Science” connotes a class all by itself, one that is better than non-science discipline, which is part of why some disciplines with a superior area of study, Man, try to mediate prestige to themselves by inculcating that they are scientists-and-they-are-just-as-much-scientists-as-people-in-the-so-called-hard-sciences-like-physics.

The concept of knowledge, as opposed to science, is perhaps in a better place. There is specific knowledge of Animals, Plants, Rocks, and Nothing. There is natural philosophy. Heather does, in fact, represent a regenerate science that, however modest it may seem, fits the bill of regenerate science very well. But this regenerate science is a department of knowledge, not something superior to the regenerate science by which she also tries to understand other people. And it may be helpful, instead of thinking in terms of “science” and “non-science,” to think in terms of “knowledge,” of which one department is the humble knowledge of a humbler domain.

Thoughts?

The Royal Letters

CJSHayward.com/royal

My dear son;

About your last letter, all that you say is true, but the way it is put together is missing something profound.

You say, “Are we not royalty?” Yes, indeed, and there is more to say. We will judge angels. To be human is to be made in a royal image. The oil we are anointed with is cut from the same cloth as the sacred oil anointing prophets, priests, and kings. In English we can say “Sir” and in koine Greek the same word means “Mister” and “Lord.” The royal gifts of the Magi, gold an emblem of kingship, frankincense an emblem of divinity, and myrrh an emblem of suffering, are given to Christ and in him extend to the Church. We are indeed royalty, and we are more than royalty.

Now moving on to your second question, “Am I pushing this too far?” That question from you has a guilty-feeling fear to it, awaiting for me to give the real correction. And my answer to that is certain. You are not pushing it too far; you are not pushing it far enough by half. You wonder about being addressed as Your Majesty, and it is my duty to inform Your Royal Highness of something buried in the Ladder, when it says: “Some stand weaponless and without armor before the kings of earth, while others hold insignia of office, shields, and swords. The former are vastly superior to the latter since they are regularly the personal relations of the king and members of the royal household.”

You stand weaponless and without armor, and wish for insignia, shield, and sword. You do not understand that you have more and pine for less. And I long for the day when you wish to be addressed, not as “Your Majesty,” but as “you,” with no insignia needed.

With love,
Your father, Oswald


My dear, dear son;

Regarding the question you raised in your last letter, I would remind you of the King of Kings.

Two of his disciples, who had been training for years, asked for as much royal honor as there was to have: to be seated at his right and left hand. And he tries to tell them that he doesn’t get it. He, the King of Kings, will never wear royal purple on earth except when he is mocked and abused by brutal soldiers; he will never wear a crown except for a twisted crown of thorns. He asks them if they can bear the sufferings of his kingship, and they blindly assure them that they can. Then he holds an example up to them and says that whoever wishes to be great must be a servant and whoever wishes to be first must be the slave of all.

What people miss in their quest for honor is the greatest gem in the crown: humility. St. Dorotheos advises people to build up their spiritual houses with all different kinds of stone: a stone of prayer here, a stone of almsgiving there, a stone of courage still there. But humility is not one more stone; it is the slime which serves as mortar and cements everything together. And this royal dignity is the bedrock that people miss hoping for royal honors, for something to feed their narcissism. Real honor is not having your narcissism fed; it is humbly rejecting narcissism. Real, industrial strength royal honor is found in the King of Kings, Lord of Lords, and God of Gods:

Let nothing be done through strife or vainglory; but in lowliness of mind let each esteem other better than themselves. Look not every man on his own things, but every man also on the things of others. Let this mind be in you, which was also in Christ Jesus: Who, being in the form of God, thought it not robbery to be equal with God: But made himself of no reputation, and took upon him the form of a servant, and was made in the likeness of men: And being found in fashion as a man, he humbled himself, and became obedient unto death, even the death of the cross.

Wherefore God also hath highly exalted him, and given him a name which is above every name: That at the name of Jesus every knee should bow, of things in heaven, and things in earth, and things under the earth; And that every tongue should confess that Jesus Christ is Lord, to the glory of God the Father.

If you want to know where the glory at the end comes from, look nowhere but the humility at the beginning. If humility is good enough for Christ, let us not consider ourselves too good for it.

Your dearly affectionate father,
Oswald


My dear son Basil;

Now I wish to show you a more excellent way.

St. Athanasios wrote of the dignity of man in On the Incarnation: “You know how it is when some great king enters a large city and dwells in one of its houses; because of his dwelling in that single house, the whole city is honoured, and enemies and robbers cease to molest it. Even so it is with the King of all…” Pay attention to how St. Athanasios proclaims the dignity of the human race! The King of Kings is the King for whom every King in Heaven and earth is named. If there is a measure of truth to say that man is the king and priest of Creation, this is because we are created in God’s image, and it is the fullness of Truth to know Christ God as King and Lord. It is no accident and no error that the prayers of the Church address God as King, for such he is, incomparably more than any man on earth. Men and kings are as the moon with its reflected light; Christ God is the original Sun, shining in its full glory. If it is a wonder to know men as kings, incomparably greater is it to know Christ God as King of Kings and Lord of Lords.

The Revelation to St. John tells of glorious creatures at the height of creature glory: “And round about the throne were four and twenty seats: and upon the seats I saw four and twenty elders sitting, clothed in white raiment; and they had on their heads crowns of gold… The four and twenty elders fall down before him that sat on the throne, and worship him that lives for ever and ever…” My dear Basil, you are a king, and I hope that Your Majesty can throw his crown before the throne of the King of Kings and Lord of Lords.

Writing with deepest fatherly affection,
Your father,
Oswald

The Angelic Letters

Doxology

Glory

A Pilgrimage from Narnia

Prayers

CJSHayward.com/prayers

A prayer of freedom

Save me from forging false gods, O Lord, and deliver me from the chains of passion I have entangled me in. Do thou raise mine eyes to Heaven, with my neck ever bowed to thee, and my hands open to thy grace and open to my neighbor. I have fallen: do thou raise me up, that I may praise and glorify thy name. Amen.

A prayer of providence

O Lord who hast created me, do thou provide for me and trust that in your heart’s plans will my highest good be real. Do thou grant me humility and faith, and obedience: all things needful for me to forsake plans of my own imagining and accept what from your hand is better than mine heart could devise. Every prodigality from this trust I have entertained; do thou forgive me, for if thou wert to only look after those that trust thee rightly, O Lord, who could stand before thee? But immeasurable is thy mercy, and incomparable is thy providence: do thou O Christ bless me, with the Father, and thine all-holy, lifegiving, and all-present Spirit, both now and ever, and unto the ages of ages. Amen.

A prayer of the Trinity

O Lord God and Father, Light of the ages, do thou illumine my soul with thy Holy Spirit, and ever impress on me the image of thy Son. Make me ever worshipful towards thee, and do thou grant me an image of repentance, and an image of compassion, and an image of prayer. I thank thee, O Lord, that thou hast not avenged thyself of my many sins, sins known and unknown to me, but hast reached to shape me with thy two hands of thy Son and Spirit. Do thou fill me with worship to thee, one God in Trinity, in the name of the Father and of the Son and of the Holy Spirit. Amen.

A prayer of mercy

O Lord Jesus Christ, the Son of God, have mercy on me, a sinner. O Lord who hast created me, by thy salvation make me whole, and by thy mercy show lovingkindness. For as thy giving is infinite, so also is thy forgiving, and although I am wounded in sin, yet may I become wounded with love for thee. I stand before thee a sinner, having practiced and invented evil, and I ask thee to heal the wounds and bruises of my soul, take away the burden of my sins, and restore me to life eternal. Great are my sins, and I cannot worthily lament them in grief, yet they are as nothing in the ocean of thy lovingkindnesses and mercies: for thy mercy is lovingkindness and thy lovingkindness is mercy. Do thou have mercy on me, a sinner. Amen.

A prayer of fire’s desctruction

O Lord, grant me watchfulness of soul: when there is a smouldering of sin, an unnoticeable flame the size of a fingertip, let it be extinguished then and there. Let me be ever watchful, and never wait for the fire to spread and grow larger before I seek to extinguish it. For thou, O Christ, canst extinguish even a fire that devoureth half of my house, and my goods with it: but let me learn watchfulness of fire, and extinguish fires when they are but a candle flame, but a smouldering wick: for why should I only put out fires when they have already devoured my substance? But do, thou O Lord, share with me out of thy substance, and let me return to thee as a prodigal if an inferno is raging, and let me return to thee as a prodigal if I play with a smouldering wick. Lord, save me from my lack of vigilant watchfulness when it seems enticing to play with the beginnings of Hellfire. O Lord, save me, in the name of the Father, and of the Son, and of the Holy Ghost. Amen.

A prayer for eyes on Heaven

O Lord, however much I struggle in ascesis, let contemplation be my goal. Let me seek first the Kingdom of God, and your perfect righteousness, and trust that all the other things that tempt me to seek them first will be given to me as well. Save me, O Lord, from activism: save me, O Lord, for contemplation. Save me, O Lord, from being too earthly minded to be of any earthly good, for living to transform the world by a secular plan: save me, O Lord, from this hydra which ever groweth new heads even when we would avoid it as spiritual poison. Help me, O Lord, to ever return my gaze to Heaven: if I cast my eyes down to undertake earthly plans seven times, let me return my gaze to higher things eight times: if I lower my gaze a thousand times, let me raise it up a thousand and once. Do thou protect and save me, and show me the path of life. Amen.

A prayer of noise

O Lord, deliver me from this intravenous drip of spiritual noise, this intravenous drip of noise that I need as little and as much as a drunkard needs one more drink. Deliver me from this drip that wears away even stone, this water torture that I will not live without. Deliver me from this spiritual din that keeps me from discovering spiritual silence: a treasure hidden in a field, that holds the joy of spiritual sobriety. Do thou grant me the silence of Heaven, and stillness in prayer. Christ God still my heart, with thine unoriginate Father and thy all-holy and life-giving Spirit.

A prayer in all things

Blessed art Thou, O God of our Fathers, and praised and glorified is thy name forever. I thank thee for all the good things thou hast given me in my life even unto this day, blessings of life and health, of food and drink, and things wherein I have no need and yet still have been blessed. Do thou have mercy on me, a sinner, and restore unto me the joy of thy salvation, and grant unto me an image of repentance and grace wherewith to worthily bear the cross Thou hast placed upon my shoulders and charged me. God, be merciful to me, a sinner.

A prayer of suffering

O Christ God, who without change became man, in whose holy and pure and lifegiving and passionless passion thou triumphedst and art become the firstborn of the dead: Grant to us, amidst our change and suffering to be changeless and without suffering, immovable in thy grace. Do thou grant us illumination in every darkness. Grant unto us, unworthy thou we be, thy whole salvation, in the name of the Father, and of the Son, and of the Holy Ghost. Amen.

A prayer of dust

O Lord, who hast created me from dust, make me ever mindful that to dust I shall return. Grant thou me humility in all things: humility towards thyself, that I may not tell thee, “No, Lord,” humility towards other men and the world that I may not impose my wishes of what they may be over what God allows them to be, and humility towards that which is mine own that I may recognize that all mine are given by thee and not one thing that is mine is mine but that thou gavedst it me. Help me make peace with things I would not have chosen, that even when I return to the ashes from which I was taken I shall accept from thy hand the cup thou givest me and return to thee in joy. Amen.

A prayer for protection

Deliver me, O Christ God, for I walk through the midst of many snares. For demons beset me, and I bear the stench of passion in my soul. But do thou grant me penitence from sin, deliverance from passion, and faithfulness in trust and obedience that the feeble audacity of the demons may be set at naught through the might of thine outstretched arm. Fence me about with the power of thy Cross by which thou triumphest over the hollow victory of darkness. Do thou watch my steps and keep mine eyes ever transfixed on thee. Amen.

A prayer of life

Give me thy Life, O Lord, and enlighten me with thy divine energies. Let my life be whole in all ways, and let me see thy Light. Have mercy on me in my sins, and rescue me from a world fallen twice: once as all men have fallen, and once again into a life moulded of plastic. Yea here and now let me live thy Life, and not some time I imagine in future circumstances; shew me thy glory and transfigure me. Lofty visions are beyond me: but in prayer and love for my neighbor allow me to participate in thy glory, thine eternal radiant splendor. In the name of the Father of Lights, and the Son who was transfigured, and the Holy Spirit who illuminest, amen.

A prayer for contentment

Lord, I beseech thee, teach me content. Teach me to be content with less; teach me that victory and trimph and wholeness come to those who take up their emptying cross even as Christ emptied himself, became man, then a servant, then emptied himself even unto death. Do thou work with me, not as I will, but as thou wilt. Amen.

A prayer for salvation from sin

O Lord and God and King, as thy mercy is immeasurable and thy forgiveness unsearchable, receive thou me, the chief of sinners. Pour out thy lovingkindness on my soul, and restore me unto thy righteousness, that the multitude of my sins and transgressions may be annihilated by thy holy mercy which be vast without measure, my wounds be healed, and the stench of my passions banished in thy fragrance forevermore. For thou art a merciful God, the God of sinners and penitent, and there is no sin that conquereth thy love to all men, nor is there found any sin which compareth to thine immeasurable lovingkindness, of the Father and of the Son and of the Holy Ghost, both now and ever and unto the ages of ages. Amen.

A prayer for help

Lord, help me! For evildoers surround me, and I am beset with snares round about. O Lord who hast created me, and hast summoned me to thee every day of my life even unto this day, look neither on my sluggishness nor procrastination, but receive this day as I turn to thee, and do thou grant me strength and humility to rely on whatever aid it beseemeth thee to send me, who turn to serve thee at the eleventh hour. Amen.

A prayer in loss

O Lord, who hast said, I am the Vine, and my Father is the Vinedresser: every branch in me that beareth not fruit he taketh away, and every branch that beareth fruit he purgeth that it may bear even more fruit: Do thou purge me; help thou my unwillingness, for I know not the sovereign love wherein thou prunest away such things as I seek. Do thou comfort me even as I am purged, and grant me to trust thy faithfulness. Amen.

A prayer for a forgiving heart

O Lord, grant unto me an image of repentance and of forgiveness, and not to hold on to the memory of wrongs done to me. O Christ, who prayed, “Father, forgive them, for they know not what they do,” pray that we might repay evil with good and pray for all who betray us, even as they know full well what they do in treachery and betrayal. Do thou help me, for I am small in heart and not wise in the ways of a forgiving heart. Help me, with thy Father and thy Holy Spirit. Amen.

A prayer of the most excellent way

O Lord, who dost grant to mankind out of thy bounty food and drink, and more than this penitence, prayer, and perseverance: let us ascend higher still to the vertues deiform and Heavenly. Beyond all prophecy and knowledge, let us grasp unto faith, hope, and love, each one a disposition of Heaven abiding in our hearts. O Lord Christ who hast shewen the most excellent way, with the Father and the Spirit of Love, do thou instill in our hearts faith, hope, and love. Amen.

Akathist Hymn to St. Philaret the Merciful

The Arena

Doxology

A Yoke That Is Easy and a Burden That Is Light

Player’s Introduction

CJSH.name/player

Read it on Kindle: part of the collection, The Minstrel’s Song

Section I: What is role play?

What is role play?

When you read a book, your imagination transports you to the long ago, the far away, the fantastic. You are there with the characters, listening and feeling with them, watching as the story unfolds.

Role play takes another step. You are still imagining goings on in a fantasy world, but not just as a passive observer: you are an active participant whose actions affect the twists and turns of the story. You aren’t just pretending to be with the great explorer, the brave adventurer, the charming minstrel; you are pretending to be that character, and he does what you decide.

The essential premise is that you have a made up character, with his own personality, likes, dislikes, goals, dreams, skills, abilities, attributes, etc. You are playing that character: you are told what your character sees and hears, what happens around him, and you choose what he does.

Your character is in a party of other player characters; these are companions and fellow adventurers who are working together towards a common goal. There is also a game master, whose role is not so much like that of one character as of the author: to serve as a referee as to events in the external world, telling what happens, what non-player characters do, and so on. (When the party walks into a town and starts looking for a tavern, an inn, a supply shop, etc., I’m the one who tells if/when they find it, who they meet on the street, what the bartender/innkeeper/shopkeeper does, and so on and so forth.)

The character should be a person, an entity, within the game world: a member of one of the seven races (Nor’krin, Tuz, Urvanovestilli, Yedidia, Jec, Shal, Janra). (A part of the character design is that it be from within one of the peoples there: a Nor’krin archer would be far more appropriate than a New York City cop who happens to have the body of a Tuz. (That’s a part of the fun of role play.)) He should also, as well as a race, have a role within the game: an adventuring related profession. (For example, archer.)

What you will do in setting up a character for my game is decide what kind of person you want her to be. To this end, I am furnishing a list of personal questions about her, and a list of skills, attributes, and virtues. In the interest of not intimidating you, let me say that they are given, not to tie you down, but to help you. I don’t expect a 500 word essay in response to every single question; my intention is rather that the questions help you think about your character — that they will spark an “Aha! I want to play a character who …”. Likewise with the skills and attributes — if you don’t need it, you’re more than welcome to play without it.

Section II: What do I need to do to start?

To start playing Hero’s Quest, you need to define a character. After the character is defined, role play can begin.

Here is roughly what should be defined in setting up a character.

  • Personality. Identity. A sense of who the character is. To help define characters, there is a list of questions to that end, and a list of virtues. A personal history is also an important and helpful part of the character’s identity.
  • Race. This is an important part of who the characters are; players should read at least the description of the race that your character is a member of, to understand part of the character’s identity.
  • Role and abilities. What skills the character has; what he can do. The list of roles and the list of skills is intended to help define this part of a character.
  • Attributes: what the character is naturally gifted at, and naturally not so gifted at. An idea of how strong or weak the character is in the listed attributes.
  • Other miscellanea:
    • Physical appearance.
    • Possessions.
    • Name.

Section III: Sample roles

The following roles are samples of what a character might build himself into. They are meant not to be a definitive limit, but illustrative of possibilities. If a particular race is especially appropriate to a role, it will follow the race. (Of course, other races could learn as well; it’s just that the particular races are especially well suited).

When a character’s role/selection of skills is being determined, one dimension worthy of consideration is whether the character will be a generalist or a specialist. On his own, a generalist is likely to be the most effective character; with a party, it is probably more useful to have specialized characters who excel at diverse skills.

The Acrobatic Scout (Janra) If you’re a Janra, you’re an acrobat. The scout in particular can roll down the passages of a cavern and maze, keeping a good sense of how to get out; he can climb walls and trees, pick locks, disappear into the shadows.

The Archer The archer can handle a bow with a virtuoso level of skill. An Urvanovestilli crossbowman has no trouble with parlor tricks such as whipping out a one-handed crossbow and shooting a coin off a child’s ear.

The Bard (Yedidia) The bard knows tunes to soothe the savage beast. He knows legends and lore, the tales of heroes; he has a decent chance of knowing at least a hint about where lost treasures might be. From extensive travel, he knows the lay of the land and pieces of local color, which inns will give you a night’s lodging if you sing for their visitors and which taverns have the best beer. The bard is an excellent storyteller and a master of words; to him, mediation is easy, and he has a most persuasive tongue.

The Hunter (Nor’krin, Tuz) The hunter is good at providing food for a whole party, and a decent woodsman to bat — can track, knows how to handle a bow (Nor’krin) or a dagger (Tuz), and knows the tricks of the wood.

The Interpreter In a world full of different languages and cultures, a party which does not all speak a common language or which is going to go to different lands will benefit immensely from having an interpreter. The interpreter will be a student of the different languages, know enough of etiquette and customs to avoid offense, and likely be a good general party mouthpiece: know how to secure provisions and a night’s roof, how much to haggle for, how to persuade people to do favors…

The Jack-of-All-Trades (Janra) The jack-of-all-trades is a dabbler who knows a little of this, a little of that — what would come in handy for an adventurer. He can track, hunt, smell creatures, move silently, hide, dodge, and handle a bow; he can pick locks, search, climb, use ropes, jump, function tolerably well in the dark… He’s in decent shape; he doesn’t wear out that quickly. He can guess what others are going to do, haggle, and knows a smattering of all the languages. He can survive in the wilderness, build fires, knows first aid, and can repair broken equipment (or at least jury-rig it to work for the moment). None of this he can do spectacularly — he is a jack of all trades and master of none — but he’s pretty good on his own and is likely to be able to do at least tolerably what nobody else in the party knows how to do.

MacGyver ’nuff said.

The Scholar (Urvanovestilli) The scholar is a very literate person who knows a lot about history and geography. He can read and write, and given time can decipher at least some of each language (and is conversant with the different literatures). It is often sages that Nor’krin seek out for advice in fulfilling their quests; they have sharp minds and extensive knowledge, which can help guide any party.

The Wayfarer The wayfarer is somewhat the jack-of-all-trades adventurer, somewhat the interpreter, somewhat the bard… He has travelled to many places and knows the different lands extensively; he’s made friends across races and has a lot of open doors.

The Woodsman (Yedidia) The woodsman knows the secrets of the wood. He knows which plants are edible, can find water without difficulty, knows which animals have passed by and which are nearby, knows a decent bit of mountaineering… He is able to track and hunt, of course, but is more than just that. He can calm animals, and enjoys having them eat out of his hand. He is at peace with the wood, and sees a great deal of beauty in it.

Section IV: The Spirit, and its Gifts

All characters are believers. As such, they have the ear of an omnipotent Father; Christ Jesus dwells in their heart; they possess the Spirit as the structure of obedience and as a power in their lives. Prayer and the motion of the Spirit are to be manifest in play; this is not included in the mathematical model, not because it is not important enough to model, but because it is too big and too important to model. (See model, section III)

The one Spirit that is present gives different gifts to specific believers; Paul, after laying out the teaching of one body whose different parts serve to a higher and necessary unity, writes (I Cor. 12:27-28, NIV):

Now you are the body of Christ, and each one of you a part of it. And in the church God has appointed first of all apostles, second prophets, third teachers, then workers of miracles, also those having gifts of healing, those able to help others, those with gifts of administration, and those speaking in different kinds of tongues.

For game purposes, a character (if so desired) may pray, asking for a specific gift or gift(s), which may or may not be given. (If something else is given, the character/player has not been bad or anything like that; it’s just that a different gift has been given.) One, or occasionally two or three gifts should be given. The gift should be appropriate to the character — his whole personality and identity — if there is one which is fitting. Gifts should not necessarily center around what is *useful* to play; it is unbelievably vulgar to think of the Spirit as a power source which is useful to characters. It is fine for not all — for that matter, none — of the characters to have gifts that happen to be useful to play. Gifts may also have different strengths, and/or different frequencies of operation, in different characters.

The gifts mentioned in the Scriptures may be given; other appropriate ones may also be given (for example, the touch given Curdie in _The_Princess_and_ _Curdie_). I’m not sure exactly how to define appropriate, but one obvious point is no imitation magic: no incantations and material components, no items with strange properties. In general, Spirit-given gifts which are consistent with how God has revealed himself in Scripture.

Specific gifts:

  • Administration:
    A Spirit-given leadership ability.Note that it is possible to have natural leadership talents without this gift of the Spirit; like several other gifts, it may not be obvious whether a person is exercising a gift of the Spirit or natural talent. (Some gifts, such as faith and helping others, are Spirit-given strong measures of qualities that all believers should have.)
  • Apostleship:
    Paul stated that he was the last of the apostles, so this gift is different from the others in only applying to a very small group of people at a very specific time. For the sake of simplicity, I will assume that player characters are not apostles.
  • Discernment of Spirits:
    As this gift applies to the discernment between angels and demons, it will not appear in its current form in the game. It will appear, however, as an ability to sense — perhaps even see, in a person in whom the gift is strong — angels.
  • Evangelism:
    A Spirit-given gift to effectively evangelize. This would not appear in a sinless world.
  • Faith:
    Someone with the gift of faith possesses a great measure of faith, and unusually powerful prayers.
  • Healing:
    The Spirit-given power to heal people.
  • Helping Others:
    A special Spirit-given ability and energy to help others, flowing out of an endowment of love.
  • Interpretation of Tongues:
    The Spirit-given ability to interpret what is spoken in tongues.
  • Knowledge:
    This gift appears in two forms.The first is a knowledge of sound doctrine — a gift that is at times not clearly distinguishable from prophecy, preaching, and teaching.

    The second, “logos gnosis” (word of knowledge), is a Spirit-given insight into facts about the external world, about other people’s needs. (This is also not always clearly distinguished from prophecy)

  • Miraculous Powers:
    Look to the Old Testament narratives surrounding Elijah for a picture of a person in whom the gift is strong.
  • Pastors:
    The gift of overseeing and caring for and nurturing the spiritual conditions of others.
  • Preaching:
    The Spirit-given ability to preach the truth in a way that is powerful and shows its relevance to believers’ lives.
  • Prophecy:
    Prophecy, Biblically speaking, is somewhat broader than the contemporary understanding of “Spirit-inspired prediction of the future.”The first and foremost meaning, of chief ecclesiastical importance, is a Spirit-inspired telling of the truth. In this aspect, I am not sure how to clearly distinguish prophecy from preaching and teaching.

    The second part of it is things such as dreams, visions, the voice of the Spirit speaking.

    The specific form the gift of prophecy takes when given to a character will take some form like this.

  • Speaking in Tongues:
    Spirit-given (moment-by-moment) speech in the tongues of men and angels.
  • Teaching:
    The Spirit-given ability to teach and impart the truth.

ONE FINAL NOTE ON THIS POINT: I am placing the Spirit in play, with greatest reverence, as someone too important to leave out. The Spirit is too big and too important to reduce to just another kind of power or just another element of play. Do not do it. Give the Spirit in play a treatment that is nothing short of worship.

I cannot give a rule to make this happen. Walk in the Spirit, and it will give you the power to do so.

Section V: A Sample of Play.

Here is a sample of play. The characters are Kendall Lightfoot, a Janra scout given prophecy, Qualinesti (regional name), an Urvanovestilli scholar given knowledge in the first sense, Pirt, a Jec wayfarer given faith, ‘Limna, a Yedidia interpreter given healing, and Torv, a Tuz hunter given the gift of help. They are currently in a Tuz village on the Urvanovestilli border. As they have been together for a while, they have all studied a common language (specifically Jec), which they have by now learned to speak with a reasonable proficiency.

I would like to emphasize that this is only one of many, many possible kinds of situations.

[…]

Pirt: “What did the riddle say, again?”

Qualinesti: “As tall as a house, as round as a cup; people drink from me without lifting me up.”

Pirt: “Hmm… [pauses in thought for a minute] I wonder if it was talking about a well. Why don’t we split up, search the village for a well, and meet back here in half an hour, and go to the well if we find one?”

Qualinesti, Kendall, ‘Limna, Torv: “Sounds good to me.”

Game Master: In half an hour’s searching, you find that the village has one well, next to the miller’s house. From the looks of it, it has been dry for quite some time. Pirt found, from a brewer, that the village now gets water from a valley about half a mile away.

Kendall: I’m going to climb down the well and search for any signs of anything interesting.

Pirt: “Would you like to borrow my lantern?”

Kendall: “Yes, thank you.”

Game Master: The well is approximately 25 feet deep; after fifteen minutes of climbing and searching, you find that one of the stones has letters chiseled into it in some script, apparently Urvanovestilli, which doesn’t spell out letters that you can read.

Kendall: “Pirt, may I also borrow your rope?”

Pirt: “Certainly.”

Kendall: I’m going to climb up, take the rope, tie a Swami seat on Qualinesti, and body belay him down into the well.

Qualinesti: “Wait a minute. How am I supposed to get back up? I can’t climb the way you can.”

Kendall: “Relax. I can belay you, and if you really can’t climb, I can pull you up. But climbing’s so easy!”

Qualinesti: “I am not a Janra.”

Kendall: I’m going to wink as I say, “We all have our problems.”

Torv: I’m going to pick Kendall up and throw him over my head.

Game Master: Kendall, are you going to try to dodge?

Kendall: Given an opportunity to fly through the air? No way!

Game Master (to himself): Why did I even ask? (to Kendall) Sure enough, you find yourself flying through the air, and land in a couple of somersaults.

Kendall: I’m going to saunter back. (to Qualinesti): “So, how about heading down to read the inscription?”

Qualinesti: Ok, I’ll head down.

Kendall: Once he’s down safely, I’ll climb down as well.

Game Master: After a little while of identifying the script — it comes from some weird dialect — you are able to decipher the message. It reads, “Do the opposite of usual to what is opposite me.”

Kendall: Hmm… no buttons to push this time. I’m going to inspect the stone again.

Game Master: You don’t find anything new.

Qualinesti: Are the stones arranged in any kind of orderly pattern?

Game Master: Yes; as a matter of fact, they are. There are thirty-two in a circle.

Qualinesti: I’m going to see if I can do anything to the opposite stone — especially pull it out.

Game Master: You can’t budge it.

Kendall: I’m going to give it a try.

Game Master: You are able to pull it out one inch, at which point you hear a sound of some kind of stonework moving. After a few seconds, the base of the well beneath you begins to tremble, and slide to the left.

Kendall: I’m going to jump up and shoot my feet out to the sides so that they catch on a foothold, and shoot an arm around Qualinesti’s waist to hold him up.

Torv: I’m going to grab the rope and brace myself so that I can pull up Qualinesti and Kendall, if need be.

Game Master: Ok. (To Qualinesti and Kendall) The stone beneath you slide out to the side, revealing stone steps receding into the darkness.

Kendall: I’m going to shift Qualinesti to my back, and climb down to the stairs, and head down.

Game Master: At the end of the stairwell is a closed door, with twenty buttons and what appears Qualinesti to be a cryptogram. It says, [hands sheet to players]

Up pqfo uif eppxbz, qsftt jo cvuupot uxp, uisff, gjwf, ojof, boe pof npsf cvuupo. Uijt pof npsf cvuupo dpoujouft uif qbuufso.

Qualinesti: [looks at it] “Both ‘uif’ and ‘pof’ are repeated; I’d be willing to guess that one of them is ‘the’. (‘nspf’ and ‘cvuupo’ are repeated, but I don’t know any four or six letter words as probable as ‘the’.) For ‘t’ to go to ‘p’ is back four; ‘h’ going to ‘o’ is forward seven; ‘e’ to ‘f’ is forward one. That doesn’t help us any. ‘t’ to ‘u’ is forward one, ‘i’ to ‘h’ is… T-o o-p-e-n… Got it!

“To open the doorway, press in buttons two, three, five, nine, and one more button. This one more button continues the pattern.

“Hmm. Two plus three is five; five plus three is eight. No, that’s not it. Two plus three is five; two plus three plus five is ten. Now if we could only find a happy medium.”

Pirt: “Two times two minus one is three; two times three minus one is five; two times five minus one is nine. Hey! I think I’ve got it. Who’s for pushing buttons two, three, five, nine, and seventeen?”

Qualinesti: “Hmm, that’s a little complicated. If we add, two plus one is three, three plus two is five, five plus four is nine… it doubles, so nine plus eight is seventeen.”

Kendall: “I think you agree. How about if we try it?”

Others: “Ok.” Game Master: Gears begin to turn, and the door hinges squeak as the door turns back.

[The party enters the underground, and after a while of puzzles and exploits, locates the map which they had been in search of. Coming out after a couple of days, they go to an inn.]

Game Master: Jim, could you come with me for a second? [pulls Kendall’s player, Jim, out of earshot of the rest of the players.] During the night, you have a dream in which an angel appears and tells you to go the cave of Munra, a great prophet and sage, which is indicated by the notched circle on the map. He tells you to examine carefully and heed the information on the map, and says that on the way you will meet three trials, which must be overcome.

Kendall: I’m going to ask the angel what the trials are.

Game Master: “That is for you to discover.” [They return to the players.]

Kendall: “Last night, I had a dream. An angel told me that we must seek out the cavern where Munra lives, which is marked by a notched circle on the map. Munra is a great prophet and sage. We need to try to understand and pay attention to the map on the way there. We will meet three trials on the way, which we must overcome before arriving.”

Qualinesti: Are there any caravans or other wayfarers travelling in that direction from the village?

Game Master: No.

Torv: “How ’bout if we all buy five days’ provisions and set out?”

Others: “Ok.”

Qualinesti: Is there a path to the cave indicated on the map?

Game Master: Yes, there is.

Qualinesti: “I suggest we follow the path.”

Others: “Ok.”

Game Master: You begin to follow the path. Along the way, Torv finds an adequate supply of rabbits, boars, and so on to keep you fed, as well as springs and streams sufficient to always have at least some water in your waterskins. After fifteen days’ travel, you come to the place indicated on the map as Riddler’s Pass. There are two ridges coming together, forcing any travellers to pass between them, and between the mountains lies a yawning chasm.

The weather is an intense thunderstorm.

Kendall: Can we climb the ledges?

Game Master: There is only sheer rock, and the top seems to be angled so that there’s nothing for a grappling hook to catch on to.

Kendall: Is there anything to secure a rope to?

Game Master: Yes; there are trees on both sides.

Kendall: I’m going to toss my grappling hook and attempt to secure a rope on the other side, then tie a noose on the other end around the rope, and attach another rope through the loop of the noose so that I can pull the rope back from the other side.

Game Master: Done.

Kendall: “How about if I shuttle across giving you each a piggyback ride, and then carry across our gear?”

Others: “Ok. We’ll wait by the edge for you to get back”

Game Master: You get Torv, Pirt, and Qualinesti over; while you are carrying ‘Limna over, a bolt of lightning strikes the tree on the far side. The electrical spasm causes Kendall with ‘Limna to jump off the rope, and the thunder blast knocks Torv, Pirt, and Qualinesti over the edge. You fall seventy five feet onto rock.

Qualinesti has a fractured femur.

Torv has a tibia/fibula fracture, and some broken ribs.

Pirt has unknown injuries; he is knocked out by the impact.

‘Limna has two broken arms.

Kendall is able to roll and reduce the damage, but he will have some severe abrasions.

Limna: I’m going to pray over myself, and then lay hands on Qualinesti, Pirt, Torv, and Kendall.

Game Master: You feel a lessening of pain as the bones begin to slide into place.

Kendall: I’m going to search around the sides for a route up.

Game Master: The sides are sheer rock and slippery rock; you can see almost nothing now. It’s unclear whether you’d be able to find a route up on a sunny day; you can’t climb out now.

Kendall, Torv, Pirt: We’re going to search for a way out.

Game Master: You don’t find anything.

Pirt: I am going to pray that a way out may be found.

Game Master: The rain begins to grow less intense, and, after about an hour, the sun begins to shine. You notice that the walls have streaks of talc reaching up to the top.

Kendall: Are there any visible climbing routes?

Game Master: No.

Kendall: “Torv, may I borrow your dagger?”

Torv: “Here you go.”

Kendall: I’m going to start seeing if I can carve holds in the the talc, hoping to find a way to the top.

Game Master: In about three hours, you get about two thirds of the way up, before coming to the end of a streak which is not within any reasonable distance of any other.

Kendall: I’m going to climb down and rest for a while.

Torv: What’s the status of the rope?

Game Master: It’s lying coiled at the edge.

Torv: Are there any small rocks around?

Game Master: Yes, there are.

Torv: I’m going to throw rocks at it to knock it down.

Game Master: You can’t throw any rocks higher than about thirty feet.

Kendall: I’m going to stuff rocks in my pockets, and climb up the talc trail to throw rocks at the rope.

Game Master: You get about halfway through before knocking it down. It falls about ten feet to your right, and goes down about twenty feet.

Kendall: “Geronimo!!!”

Game Master: You barely manage to stop yourself sliding before you reach the tip.

Kendall: I’m going to climb up, scare away any animals, and ferry the gear across, then from the other end, pull across and reanchor the rope, and help the people up. [pause] Wait. I’m going to rapell down the side and carve handholds.

Game Master: There are a couple of raccoons who have helped themselves to your food, but no other animals. You manage to do what you wanted to.

Kendall: “Thanks for letting me use your dagger, Torv. Here it is.”

Torv: “You’re welcome.”

Game Master: You continue on, and early the next day come to a fork in the path.

Pirt: What does the map say?

Game Master: The map shows only one path.

Pirt: Is one side more sharply angled, or wider, or more worn?

Game Master: Both are equally angled, equally wide, and equally worn.

Pirt: I’m going to study the map to see if I can find any hints.

Game Master: [pauses] You don’t find any.

Qualinesti: I’m going to do the same.

Game Master: You don’t find any, either.

Kendall: I’m going to pray for a word on which path to choose.

Game Master: You remember the words of an author:

And I said to him, “Sir, give me a light, that I may tread safely into the unknown.”

And he said to me, “Put thy hand into the hand of God. That will be better to thee than a light, and safer than a known way.”

Kendall: Do I receive anything else?

Game Master: No.

Pirt: “God has sent us on this quest, and I am sure that he desires that we succeed. I think we should just pick a path, and trust God that it will be the right one. Which one do you suggest?”

Kendall: “Say, left.”

Torv: “How do you know? Did you receive a word from God?”

Kendall: “I don’t. I didn’t. But I’m trusting in him.”

‘Limna: “Is that okay for everyone?”

Others: “Sounds fine.”

Pirt: “Well, let’s go, then.”

Game Master: You go along, and as you go the hunting becomes more difficult. You come to the last village before the cave, where you purchase five days’ worth of provisions, and go along… four days later, you’re almost out of water, having just enough to get back, and haven’t been able to find any along the way. It looks like another good week’s journey until you get to the cave.

Pirt: Has there been any rain or any indication of rain?

Game Master: No. You’ve come across a couple of dry creeks.

Pirt: “I say that we go along and pray to find water.”

Qualinesti: “We could go back to the village and ask about water sources.”

‘Limna: “Yes, we could, but that would mean taking a few days’ recovery from dehydration. It would mean a long delay.”

Kendall: “Point.”

Pirt: “I think that this is the third test.”

[After a continuation of deliberation, they decide to continue.]

Game Master: Two days later, you come across an abandoned well which, while tbe wood holdings, the rope and the bucket are hopelessly rotted, Kendall is able to climb down into to replenish your waterskins. Four days later, you come across a cavern twisting into the earth.

Pirt: I’m going to light my lantern, hold my breath, and walk in.

Game Master: It takes your eyes a little while to adjust to the semidarkness, and then you see an old man with a flowing, white beard, wearing a coarse woolen cloak, sitting in a chair. There is a fire in the corner of the cave.

He stands up, raises his hand in benediction, and then says something in his tongue. [pulls Jane, ‘Limna’s player, aside.] He said, “Greetings, travellers. I have been waiting for you.”

‘Limna: Unless I indicate that I’m having a private conversation with Munra, I’m going to interpret so that you can just speak for him. [to others] “He said, ‘Greetings, travellers. I have been waiting for you.'”

[‘Limna interprets for the interaction.]

Section VI: Character definition.

Here is a battery of questions designed to help players think about who the character they are designing is:

Who is he? Does Jesus sit enthroned in his heart? How does he try to imitate Christ? How does he see the world? Where do his loyalty and his love lie? How does he use his talents? What virtues does he embody? Is he temperate, controlled, balanced? What does he search for in other people? How deep are his friendships? How deep is he? How strongly does he embody the qualities he holds? What community is he a part of? What is his family, his liege, his birthplace? What inhabits his thoughts? How does he embody what is truly masculine (she embody what is truly feminine)? What fruit does he let the Spirit work in his life? What is his name?

What is his story? What interests, goals, and desires does he have? What does he cherish? What special twist does he put on things? How does he pray? What is his role in the Church? What does he create? Of what would his friends look and say, “That is him?” What is his story? What (if any) visions has he had [this question is more the focus of the DM than the player]? If he were an animal, what animal would he be, and why? What are his hobbies? What is his favorite story? What does he like to present to other people? What is he afraid of other people knowing about him? What memories does he cherish? How old is he? How has he changed over the years? How has he remained the same? What are his loyalties? Who lies closest to his heart? Who does he exist in relationship to? What communities is he a member of? How does he spend his time? What are his hopes and dreams?

What is he naturally gifted at? What skills has he developped? What would traditional game systems attribute to him? What gifts has he received in the Spirit [again, this question is more for the DM]? Prophecy? Faith? Wisdom? Knowledge? Healing? Miraculous powers? Leadership? What are his weaknesses? Does he have any handicaps? What can and can’t he do?

What does he look like? What is his manner?

What are his relationships to other characters?

Here is a listing of skills/areas of knowledge/abilities. It is meant to be illustrative rather than exclusive. (Partially borrowed from AD&D)

(A following parenthesized letter indicates that a skill is common to all members of a race: (N)or’krin, (T)uz, (Yedidia), (U)rvanovestilli, Je(C), (S)hal, (J)anra. Other parenthesized information may follow.)

  • Acrobatics/Tumbling (J)
  • Acting
  • Ambidexterity
  • Animal Handling (Y)
  • Animal Lore
  • Animal Training
  • Anatomy
  • Anthropology
  • Appraisal
  • Archery
  • Artistic Skill (Specific Medium)
  • Balance (J)
  • Biology
  • Blacksmith
  • Blind Action (S)
  • Bowyer/Fletcher
  • Brewing
  • Building
  • Carving
  • Carpentry
  • Catch
  • Ceremonies (U)
  • Charioteering
  • Chemistry
  • Climbing (J)
  • Clockwork Device Craftsmanship (U)
  • Cobbling
  • Cooking
  • Cold Tolerance (N)
  • Cultures (specific culture)
  • Dancing (Y)
  • Dodge (J)
  • Doublejointedness
  • Endurance
  • Engineering
  • Etiquette
  • Farmer (C)
  • Fire-Building
  • Fisher
  • Gambling
  • Gardening (Y)
  • Gem Cutting
  • Geography
  • Guess Actions — guess from looking at a person what he will do next.
  • Haggling
  • Hear Noise — hear almost silent noises.
  • Heat Tolerance (T,S)
  • Heraldry (U)
  • Herbalism (Y)
  • Hide
  • History (U)
  • Hunting (N,T)
  • Illusionism
  • Improvisation (Musical)
  • Incense Making
  • Janra-Ball (J) — incomprehensible to members of other races.
  • Jewelry Work
  • Juggling
  • Jumping (J)
  • Jury-Rigging
  • Keen Eyesight
  • Languages (Specific Language(s))
  • Leadership
  • Leather Working
  • Literature (U)
  • Mapmaking
  • Massage
  • Mathematics (U)
  • Mediation
  • Medicine
  • Mining
  • Move Silently
  • Mountaineering
  • Musical Composition
  • Musical Instrument (Specific Instrument)
  • Navigation
  • Open Locks
  • Painting
  • Persuasion
  • Philosophy (U)
  • Poetry Composition
  • Pole Vault (J)
  • Pottery Making
  • Public Speaking
  • Pyrotechnics
  • Reading/Writing (U)
  • Read Emotion (Y)
  • Repair
  • Riding
  • Rope Use
  • Sailing
  • Search
  • Shouting — shout loudly and prolongedly without tiring vocal chords.
  • Singing (Y)
  • Smell Creature (Y) — smell what creatures are around and have passed by.
  • Sports
  • Stonemasonry
  • Storytelling
  • Strategy Games
  • Swimming (J)
  • Symbolic Lore (N,C)
  • Tailoring
  • Technology Use (U)
  • Theology (U)
  • Tightrope Walking (J)
  • Tracking
  • Trivia
  • Ventriloquism
  • Weather Sense (Y)
  • Weaving
  • Wilderness Survival (N,T,Y)
  • Withdrawing/Meditation (S)
  • Woodlore (Y)
  • Wrestling (J,T)

Here is a list of some attributes, to think about how strong or weak a character might be:

  • Ability to Learn
  • Agility
  • Charisma
  • Constitution
  • Dexterity
  • Intelligence
  • Knowledge
  • Memory
  • Perception
  • Speed
  • Strength
  • Wisdom

Possible virtues to think about how a character embodies goodness:

  • Balance
  • Chastity
  • Compassion
  • Contrainte
  • Courage
  • Faith
  • Faithfulness
  • Forgiveness
  • Generosity
  • Gentleness
  • Honesty
  • Honor
  • Hope
  • Humility
  • Joy
  • Justice
  • Kindness
  • Mercy
  • Moderation
  • Love
  • Obedience
  • Patience
  • Peace
  • Penitence
  • Purity
  • Self-Control
  • Simplicity
  • Submission
  • Wisdom

A Dream of Light

Espiriticthus: cultures of a fantasy world not touched by evil

The Sign of the Grail

Unashamed

Theology of Play

CJSH.name/play

Most of Christianity that I’ve come into contact with has a well developed theology of work; sometimes called the Protestant Work Ethic, it is summarized in the verse, “Whatever you do, do it heartily, as if unto the Lord.” (Col. 3:23). A mature Christian is characterized by hard work, and I do not wish to detract from that, but there is a counterpart to theology of work: theology of play.

It would probably be easier to defend a point of doctrine involving great self sacrifice – that a Christian should be so loyal to Christ that the prospect of being tortured and killed for this devotion is regarded as an honor, that a Christian should be willing to serve in boring and humiliating ways, that a Christian should resist temptation that takes the form of an apparent opportunity for great pleasure – but I will still state and explain this point: a Christian should be joyful, and furthermore that this joy should express itself in play and celebration.

When Paul describes the fruit of the Spirit, the first word he uses is love. Love will certainly apply itself by hard work. He goes on to describe it as patience, faithfulness, self-control. Patience, faithfulness, and self-control all have important application to hard work. But the second word is joy. If the fruit of the Spirit will yield hard work, it will also yield expressions of joy.

C.S. Lewis said that the greatest thing that the Psalms did for him was express the joy that made David dance. Doctrinal development is one of the reasons that God gave us the Bible, but it is not the sole reason. I would not by any means suggest that omitting Paul’s epistles would improve the Bible, but there is a lot of the Bible that I read for the sheer joy and beauty as much as anything else. Psalm 148, one of my favorite, beautifully embellishes the word, “Halleluyah!” That alone is reason sufficient to merit its placement in the Bible. When the Psalms tell us that we should sing unto Yahweh, it is not telling us of a dreadful and terrible duty that we must endure because God says so. By contrast, it is encouraging an expression of joy. I try to show myself to the world primarily as a person of love, but I have also had a strong witness among the unbelievers as a person of joy; one of the stereotypes of a Christian that I have been glad to shatter is that of a repressed and repressive person. The stereotype says that a person who tries to live by the Bible’s moral standards will have a somber life devoid of joy; I thus try to let the deep and inner joy “I’ve got a river of life flowing out of me…” that the Holy Spirit has placed in my heart show itself to them. Satan likes to take and twist pleasure into enticement for his evils; that does not make pleasure an evil thing. Yahweh made pleasure – the idea that Satan could imagine such a thing on his own is risible (for Satan cannot create; he can only mock) – and pleasure is intended for Christians to partake.

Celebration is something that can certainly come from things going well, but it is not a grave evil that is justified only by exceptional cause; it is a way of life. Some of celebration, some expressions of joy and thanksgiving, are in response to an event we are pleased at and thankful for, and rightly so, but celebration is not something to be reserved for rare occasions. I may be celebrating an event, but Christ is reason well sufficient for celebration; consequently, it is appropriate to celebrate, even when you can’t point to an exceptional event. There is a time to mourn, but a Christian does not need extenuating circumstances as reason to celebrate.

I am not going to attempt to provide an exhaustive list of expressions of joy, and most definitely do not wish to provide commands which must be successively fulfilled to the letter and verified in triplicate, but I think that a few suggested variants of “stop and smell the roses” are in order:

Call a friend you haven’t talked to in a while.

Read a children’s book.

When it’s warm, take off your shoes, close your eyes, and feel the grass under your feet.

Stop and remember five things you are glad for; thank God for them.

Drink a mug of hot cocoa. Slowly.

Go go a local art museum.

Hug a friend.

Climb a tree.

Close your eyes and imagine yourself somewhere else.

Sneak up behind a friend who is ticklish…

In addition to these that I’ve pulled off the top of my head, I’d like to look at three recurring, decidedly Biblical expressions of joy, and how many Christians have reacted to them.

  • Singing. The Christian understanding of music is summed up in the words, “Make a joyful noise unto Yahweh.” While it can also be solemn, music was created as a beautiful expression of joy. When Paul encourages the believers to sing to one another, he is not really appealing to a sense of duty, but rather encouraging a celebratory and joyful pleasure in this good gift of God. The jail warden was astounded to find that Paul was happily singing when he was imprisoned; this joy expressed itself in so powerful of a manner that it opened the warden’s ears so that he, too, would gain this welling up of life, flowing into joy. Most Christians sing (even if some of the music has room for improvement); this is good. believe that Yahweh is pleased when he listens. This is Biblical.
  • Dance. One of the expressions of celebration recorded in the Bible, as well as song, is dance.In Exodus, after Israel passed through the red sea and Egypt didn’t, Moses’s song is followed after a couple of verses with the words, “Then the prophet Miriam, Aaron’s sister, took a tambourine in her hand; and all the women went out after with tambourines and with dancing.” In Samuel, it is asked, “Is this not David the king of the land? Did they not sing to one another of him in dances, ‘Saul has killed his thousands, and David his ten thousands?'”, and recorded, “David danced before Yahweh with all his might.” The psalms jubilantly sing, “Let them praise his name with dancing, making melody to him with tambourine and lyre.” and “Praise him with tambourine and dance; praise him with strings and pipe!” In Ecclesiastes, dancing is identified with joy: “…a time to weep, and a time to laugh; a time to mourn, and a time to dance…” Jeremiah issues words of comfort, saying, “Again I will build you, and you shall be built, O virgin Israel! Again you shall take your tambourines, and go forth in the dance of merrymakers.” In Lamentation he also identifies dancing with joy, saying, “The joy of our hearts has ceased; our dancing has been turned to mourning.”

    It is not without reason that dance is a part of the worship services of Messianic Jews. It is not without reason that a song that has come to us from Africa states, “If the Spirit of the Lord moves in my soul, like David the victor I dance.” The shaker hymn very beautifully states, “Dance, then, wherever you may be, for I am the Lord of the Dance, said he.” Throughout, the hymn describes the walk of faith as a dance. Dancing is a good thing, an act of joy, that has been given to us by Yahweh himself for our good.

    There are a few forms of dance that are essentially sex with clothes in the way, and should be avoided outside of a marital context. Because of the existence of these dances, some Christians have attacked dance as demonic; “Dance before Yahweh” necessitates an interpretation of “Dance alone before Yahweh.”

    This is silly. Celebration is meant to be enjoyed in community; its nature is not a selfish “I like this and I’m going to keep it all to myself,” but a generous, “This is so good that I have to share it with you as well.” This is the mark of a child fully enjoying a lollipop. When holidays and other times of celebration come, people want to be with friends and family, and it would be only a slight exaggeration to say that this is the whole reason that believers come together for worship services.

    Dance, also, should be enjoyed in community.

  • Proper use of wine.In Judges, the vine refuses an offer to be the king over all trees, saying, “Shall I stop producing my wine that cheers gods and mortals, and go to sway over the trees?” The Psalms likewise describe material blessings by saying, “You cause grass to grow for the cattle, and plants for people to use, to bring forth food from the earth, and wine to gladden the human heart, oil to make the face shine, and bread to strengthen the human heart.”, and Ecclesiastes, “Feasts are made for laughter; wine gladdens life…” The Song of Songs, in its description of the erotic, says, “Let him kiss me with the kisses of his mouth! For your love is better than wine… How sweet is your love, my sister, my bride! how much better is your love than wine…”, comparisons that would mean little if wine were not understood to be a good thing. Isaiah accuses Israel of apostasy in the words, “Your silver has become dross, your wine is mixed with water.” He Israel to a vineyard created so its master may enjoy its wine; elsewhere appear the words, “On this mountain Yahweh Sabaoth will make for all peoples a feast of rich food, a feast of well-aged wines, of rich food filled with marrow, of well-aged wines strained clear.” Jeremiah contains Psalmlike words of celebration: “They shall come and sing aloud on the height of Zion, and they shall be radiant over the goodness of Yahweh, over the grain, the wine, and the oil, and over the young of the flock and the herd; their life shall become like a watered garden, and they shall never languish again.” Hosea, in sadness at apostasy, makes it clear that wine is a gift from above: “She did not know that it was I who gave her the grain, the wine, and the oil, and who lavished upon her silver and gold that they used for Baal.”

    Going from the Old Testament to the New, it is seen that Jesus was accused of being a drunkard; for his first miracle, he turned water to wine, thus permitting a celebration to continue.

    Now, it should be mentioned that alcohol is something that merits an appropriate respect and caution; consumed in excess, it is a deadly poison. It has been said that we should thank God for beer and burgundy by not drinking too much of them. Our culture has largely cast aside the virtue of moderation and the belief that a sin could be sin because it takes a good thing to excess (gluttony is not mentioned as a sin very often, and a great many people would be healthier to lose some weight). Not everybody thought this way. The ancient Greeks accorded moderation a place as one of the four cardinal virtues, and Paul named temperance and self-control as the final of the virtues listed as the fruit of the Spirit. Liquor, like most good things, should be consumed in a temperate, controlled, and balanced manner. And, like most good things, it becomes a bane if it is taken out of proper context. It was not without reason that Solomon wrote that wine is a mocker and beer a brawler. This country has age related laws pertaining to alcohol, and they should not be violated Granted that those laws be obeyed, it would be wise to consider to the advice to Jesus ben Sirach, who in his writing said, “Do not try to prove your strength by wine drinking, for wine has destroyed many. As the furnace tests the work of the smith, so wine tests hearts when the insolent quarrel. Wine is very life to human beings if taken in moderation. What is life to one who is without wine? It has been created to make people happy. Wine drunk at the proper time and in moderation is rejoicing of heart and gladness of soul.” Elsewhere comparing wine to music, he regards wine as a good part of celebration.

There are many things that should be made manifest in the life of Christians; community, freedom, and celebration are important. Paul writes in Galatians, “For freedom Christ has set us free. Stand firm, therefore, and do not submit again to a yoke of slavery.”, in Colossians, “Therefore do not let anyone condemn you in matters of food and drink…. If with Christ you died to the elemental spirits of the universe, why do you live as if you still belonged to the world? Why do you submit to regulations, ‘Do not handle, Do not taste, Do not touch’?”, and in I Timothy, “Now the Spirit expressly says that in later times some will renounce the faith by paying attention to the teachings of demons, through the hypocrisy of liars whose consciences are seared with a hot iron. They forbid marriage and demand abstinence from foods, which God created to be received with thanksgiving by those who believe and know the truth. For everything created by God is good, and nothing is to be rejected, provided it is received with thanksgiving; for it is sanctified by God’s word and by prayer.”

So let us enjoy the gifts that God has bestowed.

(scripture quotations generally NRSV)

A Dream of Light

A Glimpse Through a Crystal

Money

Why This Waste?

Pinax 0.7.3 Made Available Once Again

CJSHayward.com/pinax

You want 0.9.x

This page is being kept available for historical reasons, however if you want a Pinax social project, you probably want Stackato’s github of pinax-social-project.

This Pinax project does not represent my own creation in any way. This webpage is intended to provide something useful that is well nigh impossible to track down on the web.

This page assumes that you know what Django, “the Web Framework for Perfectionists with Deadlines,” and Pinax are, and that you know basically how to use them. If you want to read documentation on these projects, that’s fine; the Django tutorial is here, the Django book is here, and Pinax documentation is here. For mailing list support, there is the django-users mailing list and the pinax-users mailing list.

This older version of Pinax, Pinax 0.7.3, is made available for the simple reason that I wanted to make a social network, and the 1.0.0 hot snazzy new pinax-social project is a stub with only one real page, with “lorem ipsum” instead of real content. In other words, Pinax 0.7.3 provides a real social network, while Pinax 1.0.0 presents a stub as a social network. Patrick Oltman said in response to a “How can I build tribes social network-style under 1.0.0, “We have made Pinax much more modular. Pinax itself is more of an ecosystem of reusable apps, starter projects, and themes. We should probably build a proper social starter project but am curious as to what specific features you’d be interested in having in it.” I answered, “Well, the same or better for the 0.7 starter project would be fantastic.”

Wherever things stand, Pinax 0.7.x provided a real, fully working social network as a starter project, and as best I can tell, Pinax 1.0.0 says, “Here are a bunch of Lego blocks; you can build whatever you want.” But for now at least, they have discontinued the pre-built, fully functioning social network. We may be free to build a social network from the modular building blocks: but a prebuilt social project appears to be off the agenda.

You can download the 0.7.3 bundle from http://CJSHayward.com/pinax/Pinax-0.7.3-bundle.tar.gz.

From there, you can:

  • easy_install pip, if pip is not installed.
  • pip install virtualenv.
  • virtualenv ~/social-environment.
  • source ~/social-environment/bin/activate.
  • pinax-admin clone_project social_project my_social_project, (or download a branded and themed social project from http://CJSHayward.com/pinax/clay.tar.gz.
  • pip install gnunicorn.
  • Change directory to my_social_project or whatever you named your project.
  • Put 'gunicorn,' under INSTALLED_APPS in settings.py
  • run a python manage.py syncdb (if you used the existing project, deleting clay/dev.db first so you can set the administrative user first), and finally:
  • run python manage.py run_gunicorn 0.0.0.0:8000 to run the server.

I am not positive of these instructions; they are as I best remember as posted from a machine that won’t play nice with Pinax. However, they do outline to a Django/Pinax user what needs to be done. If you notice a flaw in these instructions, please contact me immediately.

Download Pinax-0.7.3-bundle.tar.gz.

Tinkering With Perl

CJSH.name/perl

Table of Contents

Most books you will find on Perl or any other programming language, are books intended to be a one-size-fits-all — or, at least, that’s how they’re advertised. This book does not attempt or pretend to be appropriate to most users; instead, I am trying to do one thing well.

Well, what am I trying to do? Let me first tell what I am not trying to do:

  • I am not trying to make a book that will be helpful to experienced programmers who want to pick up Perl.
  • I am not trying to make a book that will treat Perl in depth, or for that matter even touch many of the language’s strongest points.
  • I am not trying to make a book that will make a novice programmer into an expert programmer overnight.
  • I am not trying to introduce most principles of good software engineering.
  • I am not trying to make a book that promises quick results overnight; I am not trying to make a book that will quickly tell you how to get such-and-such done.

Well, if I am not trying to do all of that, then what am I trying todo?

I wrote this because trying to do this: create a book that would help my brothers learn to tinker.

I first tried to start my brothers straight off with Java. And Java is a ood language — it might have been better for them to know than Perl, and I think it would be a good second language to teach, when they are ready to mature, so that they can produce high quality software. But to learn all of those principles all at once is a heavy load, and one which can be confusing. I was telling them very good things, but I was boring them.

Then I began to think about how I first began to program. I first began to tinker in middle school with BASIC, on Apple ][ series computers. I wrote spaghetti code laced with gotos and all sorts of other things I would shudder to do now. I did not then learn to be a good programmer — at all. But I did learn to be a tinkerer, to play around and explore and put things together. It has been said that education is not the filling of a pail, but the lighting of a fire. That experience lit my fire; it started the curiosity and enjoyment that later caused me to become a more serious programmer.

This book is not an attempt to immediately achieve the end result of a good programmer. It has a goal which might be called more modest, but which might be called much more ambitious: lighting a fire. Once the fire is lit, it can be tended and carefully pruned; there will be plenty of time for the channeling and discipline necessary to let the fire achieve truly great things. I am not trying to do everything; I am trying, for now, to do just one thing. And do it reasonably well.

Chapter Zero: Preliminaries
Unix preliminaries
Directories
pwd
cd
mkdir
ls
Files
Editors
joe
Shebang
Permissions
chmod
Running your programs

Chapter One: Fundamentals
Comments
Variables
Scalars
Lists
Hashes
Statements
Assignment of variables
Assignment of scalars
Arithmetic
Assignment of lists
Assignment of hashes
Input and output
Input
Output
Flow control
Blocks
Conditional clauses
If-then
If-then-else
If-then-else chains
Loops
Foreach loops
While loops
For loops
Subroutines and functions
Arguments
Subroutines
Functions

Chapter two: Sample programs
Friends and pets
Running average

Chapter three: Debugging
Common types of bugs
Syntax errors
Misspelling
Forgotten semicolon
Single and double equals signs

Conclusion

Glossary

Preface

This book has two prefaces: one for a guiding adult, and one for a sharp child who will be exploring the language.

Preface (for children)

When you were younger — perhaps even now — you played or play with Legos, or some other similar building toy. When I was a boy, I played with Legos a lot, and I was very sad when my elaborate collection was destroyed.

Growing up means changing in some ways, but there are also ways in which an adult remains forever a child. It is a truly sad thing when the child inside of a grown-up dies; something important has gone out.

I am a grown-up now, and I still play with Legos. Only now, I play with them in a different form. Instead of using Legos that you can see, I use Legos that you can only see with your mind — I have to use my imagination. I play with these Legos when I program.

When you are holding Legos in your hand, you have in your head an idea of what you want to build. And you start putting the little bricks together, piece by piece, until you have built the thing you’ve imagined in your head. One little brick is very small and very simple — but there are ways to put them together, and if you put things together the right way, you can do some amazing things.

It is the same way with programming. This book will show you some of the little bricks we have, and then look at ways to put them together. It is my hope that you will begin to tinker — see how you can put things together, see what works, what doesn’t work. Then maybe you will imagine things, and see if you can build them out of these programming bricks.

There are many things to learn in programming, and this is only a beginning. But I hope that I may be able to help you begin to explore, and discover what it can be like to program.

Preface (for adults)

Most books you will find on Perl or any other programming language, are books intended to be a one-size-fits-all — or, at least, that’s how they’re advertised. This book does not attempt or pretend to be appropriate to most users; instead, I am trying to do one thing well.

Well, what am I trying to do? Let me first tell what I am not trying to do:

  • I am not trying to make a book that will be helpful to experienced programmers who want to pick up Perl.
  • I am not trying to make a book that will treat Perl in depth, or for that matter even touch many of the language’s strongest points.
  • I am not trying to make a book that will make a novice programmer into an expert programmer overnight.
  • I am not trying to introduce most principles of good software engineering.
  • I am not trying to make a book that promises quick results overnight; I am not trying to make a book that will quickly tell you how to get such-and-such done.

Well, if I am not trying to do all of that, then what am I trying to do?

I am trying to do this: create a book that will help my twelve year old twin brothers learn to tinker.

I first tried to start my little brothers straight off with Java. And Java is a good language — it will probably be better for them to know than Perl, and I think it would be a good second language to teach, when they are ready to mature, so that they can produce high quality software. But to learn all of those principles all at once is a heavy load, and one which can be confusing. I was telling them very good things, but I was boring them.

Then I began to think about how I first began to program. I first began to tinker in middle school with BASIC, on Apple ][ series computers. I wrote spaghetti code laced with gotos and all sorts of other things I would shudder to do now. I did not then learn to be a good programmer — at all. But I did learn to be a tinkerer, to play around and explore and put things together. It has been said that education is not the filling of a pail, but the lighting of a fire. That experience lit my fire; it started the curiosity and enjoyment that later caused me to become a real programmer.

This book is not an attempt to immediately achieve the end result of a good programmer in all regards. It has a goal which might be called more modest, but which I believe is ultimately more important: that of lighting the child’s fire. Once the fire is lit, it can be tended and carefully pruned; there will be plenty of time for the channeling and discipline necessary to let the fire achieve truly great things. I am not trying to do everything; I am trying, for now, to do one thing well.

C.J.S. Hayward, 7-16-98

P.S. There are some intentional inaccuracies. This is because a fully technical treatment of the issues involved would, I believe, needlessly confuse children. Some parts are oversimplified; I intend them to be overridden by more nuanced treatments when an appropriate level of intellectual maturity is reached.

Some preliminaries

Here, we aren’t (for the most part) really talking about Perl; we’re talking about some basics that need to be done in order to use Perl. I will restrict my attention to unix machines. If you use another machine, you will have to read the documentation on your machine.

See also:

Unix preliminaries

Unix preliminaries

Here we will discuss directories, files, editors, permissions, and the famous shebang notation.

See also:

Preliminaries in generalDirectoriesFilesEditorsShebangPermissions

Directories

Directories in Unix are the same as folders on other machines. They’re a place to keep files.

There are four basic commands you need to know about directories: pwd, cd, mkdir, and ls.

Directories are stored heirarchically. This means that there’s a top level directory, which contains some directories, and each of those directories may contain some files and some directories, and so on. The full name of a direcory is something like this:

/home/jhayward/perl_guide/text/chapter_0/unix

The slashes ('/') tell where we are. The beginning slash indicates the root directory, the top directory of all; home indicates that I’m in the home direcotory in the root directory, jhayward indicates that I am in the directory called jhayward in the home directory (which is my directory to do stuff in), and so on and so forth.

You may refer to a file or directory by its absolute or relative pathname. If you specify its absolute pathname, you give the full path, all the way from the root directory down to where you are now. If you give a relative path, you tell where it is relative to where you are now. The file I am now editing has absolute pathname:

/home/jhayward/perl_guide/text/chapter_0/unix/directories.html

and relative pathname:

directories.html

from where I am now.

The directory .., in a given directory, is the directory one level up. So the directory

/home/jhayward/perl_guide/text/chapter_0/unix/..

is the same as the directory

/home/jhayward/perl_guide/text/chapter_0/

See also:

pwdcdmkdirlsFiles

pwd

pwd is a Unix command that means print working directory. It prints the directory you’re in now. If you’re logged in to a Unix machine, why don’t you type pwd (and hit return) to see what happens?

You can use pwd to see where you are; make sure you’re in the right directory.

See also:

Unix preliminariesDirectoriescdmkdir

cd

cd is a Unix command which means change directory. It changes the directory you are in to another one.

In general, you can type:

cd pathname

where pathname is the absolute or relative pathname (as discussed before) of the directory. For example, to go to the parent directory (the directory one level above) for your current working directory, you can type:

cd ..

What do you think will be the result of typing in the following commands:

pwd
cd ..
pwd

Why don’t you type them in, and see what happens?

Finally, as a special case, if you type

cd

without anything else after it, it will take you to your home directory. Your home directory is the directory you are given on the computer to do things in.

See also:

Unix preliminariesDirectoriespwdmkdir

mkdir

mkdir is the command to make a directory. We will probably be making files as we tinker; let’s create a directory for those files.

First, go to your home directory:

cd

Then make a directory — say, one called tinkering.

mkdir tinkering

Now, we should go into that directory before doing most of the other things suggested in this book. So go into that directory:

cd tinkering

Remember to go to that directory before each time you start reading this book. If you’re not sure what directory you’re in, you can always type

pwd

to find out what directory you’re in. From any place in the system, you can type in the following to go to your tinkering directory:

cd
cd tinkering

Now we’re ready to talk about files and editors.

See also:

Unix preliminariesDirectoriespwdcdls

ls

ls is the Unix command to list the files in a directory. To see what files and directories are in your current directory, type:

ls

You may not see anything — if you are following this book in order, you should be in an empty directory. Keep this command in mind, though; it should come in handy in the future.

See also:

Unix preliminariesDirectoriespwdcdmkdirFilesEditors

Files

A directory is a place to keep things on a computer; a file is what sort of thing you actually keep. We are going to be interested in creating, and modifying, Perl programs.

A file should have a name consisting of letters, numbers, and/or underscores. Perl programs should end by having “.pl” added to the end. Here are some examples of good filenames:

hello_world.pl
test.pl
list_pets.pl

Each file (of the sort we’re working with) will hold one program, and (for now) each program will be stored in one file. So a file is where you store a program. You will create these programs with editors, and then make them usable by setting the permissions.

See also:

Unix preliminariesDirectorieslsEditorsPermissions

Editors

Editors are programs that can be used to create and change files. In our case, we are interested in text editors, which are specifically for editing filies that contain text.

There are a number of different editors, each of which has its own strengths and weaknesses. For now, I will have you use an easy-to-use editor called joe.

See also:

Unix preliminariesFilesjoe

joe

joe is the name of an easy to use editor for Unix systems. To use joe to create a file called hello_world.pl, type:

joe hello_world.pl

You will now see a screen that is mostly blank. Type control-K and then 'H' to get a help screen. That will bring up on the screen most of the commands you need to know to edit files.

We are going to create our very own program. Type in the following, exactly as you see it on the screen:

#!/usr/local/bin/perl

print "Hello world!\n";

Then type control-K and X to save the file. It will ask you what file to save it as; type:

hello_world.pl

Keep reading to find out how to run the program.

See also:

Unix preliminariesFilesEditorsShebangPermissions

ShebangIn Unix, the characters “#!” at the beginning of a file tell the computer what program to use to figure out what to do with it. This is referred to as the shebang notation.

In order to tell the computer that your files are Perl programs, you should put the following line at the beginning of every Perl program, exactly as it is typed here:

#!/usr/local/bin/perl -w

or

#!/usr/bin/perl -w

(Which one should you use? One of them will work, and the other won’t. Try it.)

If you don’t do that, the computer will be very confused when you tell it to run your programs.

See also:

Unix preliminariesFilesEditorsPermissions

Permissions

When you create a text file, Unix doesn’t normally expect that you’re going to run it like a program. So, you have to tell it that you’re giving yourself and perhaps others permission to run them as programs.

This is accomplished with the chmod command.

See also:

Unix preliminariesFileschmod

chmod

chmod is the Unix command used to set permissions, including telling the computer that a file can be run as a program.

To make it so that everybody can use a program, type:

chmod 755 filename

where filename is the name of the file, which should be something like “hello_world.pl”.

Alternately, to make it so that only you can use the program, type:

chmod 700 filename

You must do this before you can run a program. If you’ve been following along this book in order, please type:

chmod 755 hello_world.pl

And now, you’re ready to run it!

See also:

PreliminariesFilesPermissions

Running your programs

If you’ve been following along the text in order, you have created a program, and made it executable (runnable). Now, you can run it:

hello_world.pl

What happened? Did it print out, “Hello, world?” If so, great! If not, you probably made a little mistake somewhere — as has every programmer, great or small — and you need to go back and see what happened.

See also:

Unix preliminariesFilesShebangPermissions

Fundamentals

This chapter introduces the basic building blocks you will combine and fit together to make programs.

Comments

When you are writing a program, you are writing for people as well as computers. Most of the time, after a program is written, you or someone else will want to make changes — to add new features, or to fix bugs. There is a joke which my father likes to tell:

A construction worker, at lunch break, opens his lunchbox, and says, “Salami again! I hate bologna!”

Then, the next day, he says, “I wonder what I have today.” He opens his lunchbox, and says, “Bologna again? I hate bologna!”

This continues for a week. Finally, one of his coworkers says, “Why don’t you ask your wife to give you something else for lunch? That way, you wouldn’t have to have bologna all the time.”

The construction worker says, “Oh, I don’t have a wife. I make my own lunches!”

In this joke, the construction worker eats the sandwiches he hates because that’s what he made earlier. This joke is a lot like programming. The construction worker is like a programmer, and the yucky bologna sandwiches are programs that don’t have very many little notes, in English, to explain things. It can be very difficult, even for experienced programmers, to figure out or remember what a program is doing if it doesn’t have notes to explain things. These little notes are called comments, and you can say anything you like in a comment. (But we generally use comments to explain programs.)

Comments are done differently in different computer languages, but there is some feature that tells the computer what is a comment and what is the rest of the program. In perl, a comment begins with a hash mark ('#'), and continues to the end of the line. If you want to make a comment that uses more than one line, put a hash mark on a second line. Here are some examples of what is and is not a comment:

# This is a comment.

# This is a comment, which
# uses more than one line.

#
# This is a comment, too.  It uses blank lines to make
# things better to look at.
#

                # This is a comment which begins in the
		# middle of a line.  You can put a
		# comment to the right of something 
		# else, to explain what it does.

This is not a comment.

The comment begins #here.

See also:

Statements

Variables

In school, you may have used variables to refer to different numbers. The variables x could be 3, or 4, or 0, or -9.5. One variable can mean any of several different numbers. (But it can only mean one thing at a time.)

In computer programming, we use variables to represent all sorts of different things. In Perl, there are three different types of variables we will use: scalars, lists, and hashes. The names sound a little funny, but don’t let that scare you.

See also:

ScalarsListsHashesAssignment of variables in general

Scalars

A scalar is a variable that can either refer to a number, or some text, which is called a string. A string is usually enclosed in quotes, like this:

"This is a string."

Note that the quotes are not actually part of the string; they are put around the string to tell when the string begins and ends.

You can give a variable almost any name that you can make from letters, numbers, and underscores ('_'). Furthermore, you must put a dollar sign ('$') before a scalar to tell Perl that it is a scalar.

In general, it is a good idea to have a variable name consist of a few words that describe what the variable tells you. There are a couple of ways people have of putting words together. (You have to do something to tell when one word ends and the next begins, because itishardtoreadwhenyoucan’tseparatewords.) One way is to capitalize the first letter of each word; another is to separate words using underscores ('_'). It doesn’t matter which way you do it, but you should pick one way and stick with it. It is very important that you spell a variable exactly the same way every time you use it; otherwise, the computer will think you are using different variables. Here are some examples of good variable names:

$NumberOfTrucks
$AverageHeight
$PlayerName

Or, if you prefer underscores, then you can do it this way:

$number_of_trucks
$average_height
$player_name

In this book, I will always do it the first way.

See also:

VariablesListsHashesAssignment of variables in generalAssignment of scalarsArithmetic

Lists

A list is a variable that lets you keep track of several things. If you were shopping for groceries, you’d keep a list: apples, ketchup, bread, sausage, and so on. A list is a variable that keeps track of several things, instead of just one. A list is named like a scalar, but instead of having a dollar sign ('$') in front of the name, we place an atgry ('@'). A good name for a list would be something like:

@GroceriesToBuy

See also:

Variables in generalScalarsHashesAssignment of variables in generalAssignment of lists

Hashes

Hashes are a little more complicated than either lists or scalars, but they are very useful.

Let’s say that you know some people, and you want to keep track of what kind of pets they have. Suppose that you know John, Sue, and Mary. Let’s also suppose that John has a dog, Sue has a cat, and Mary has a goldfish. What would be good would be a single variable, called Pet: if you plugged in John, you would get dog; if you plugged in Sue, you would get cat; if you plugged in Mary, you would get goldfish.

A hash is a variable that can do that. We refer to a hash in slightly different ways, depending on what you want to do. If you refer to the whole hash, you put a percent sign ('%') in front of the hash. So the hash with the pets might be:

%pet

But if you want to refer to a specific pet — say, you want to find out what pet Mary has — you would do it like this:

$pet{"Mary"}

(We put the “Mary” in quotes, because it is a string, and the computer will get confused if it sees the letters M, a, r, and y all by themselves.)The expression

$pet{"Mary"}

should be read as, “Mary’s pet”.

See also:

Variables in generalScalarsListsAssignment of variablesAssignment of hashes

Statements

Let’s say that you are going to play at a friend’s house. What you might do, could be explained as a list of activities:

Ask your parents for permission to visit your friend.
Call your friend’s house, and ask permission to come over.
Finish getting dressed.
Walk over to your friend’s house.
Take chewing gumm off of your shoe.
Greet your friend.
Play with your friend.
Eat a snack.
Play some more.
Say goodbye.
Walk home.
Take off your shoes.

What we have done here, is to break one bigger activity (visiting your activity) into a sequence of smaller activities. Another way of putting it is that we are explaining how to visit your friend by saying what smaller things are necessary to visit your friend.

When you are programming a computer, you do the same thing. The little commands are called statements. A statement is a command that tells a computer to do something small, as a part of doing something larger. (Saying to walk to your friend’s house, when you are explaining how to visit your friend, is like a statement.)

As we work further, we will learn more about different kinds of statements. But first, let’s make sure that we understand what a statement is: a statement is an individual command you give to the computer, as part of telling it how to do something. In the description of how to visit a friend’s house, each line, like “Greet your friend,” or “Remove chewing gum from your shoe,” is like a statement. The whole list, all together, is like a program.

One final note about statements: In English, you usually end a sentence with a period ('.'). In Perl and many other computer languages, you end most statements with a semicolon (';'). For example:

This sentence ends like a statement;

See also:

Assignment of variablesInput and outputBlocksIf-thenLoopsSubroutines

Assignment of variablesIn math class, with a story problem, your teacher might have said something like this: “Suppose we have five cats…” What is going on here is that we have some number of cats, and we are saying that the number of cats is specifically equal to five.

Another way of saying what the teacher said is,

Let the number of cats be five.

We can use a variable for the number of cats. Let’s put a variable in there:

Let NumberOfCats be five.

Or, to say it a little differently,

Let NumberOfCats equal five.

With computers, we drop the ‘let’, even though it’s understood.

NumberOfCats equals five.

(Now, we are not simply claiming that the number of cats equals five. We are commanding that it be so.)

Finally, in Perl, we use an equals sign ('=') when we mean “equals”, and we use numerals: we write '5' instead of “five”. And remember — most statements end with a semicolon, and we put a dollar sign ('$') in front of scalars. So let’s change the period into a semicolon, and put a dollar sign in front of the variable:

$NumberOfCats = 5;

And that’s how we do it in Perl. We have just assigned the variable NumberOfCats a value of five.

We can also assign a variable to other things. For example, if we know the number of cats, and we know the total number of cats and dogs, we can find out the number of dogs by subtracting. If we have thirteen cats and dogs total, and five cats, then here is how we can get the number of dogs:

$NumberOfCats = 5;
$NumberOfCatsAndDogs = 13;
$NumberOfDogs = $NumberOfCatsAndDogs - $NumberOfCats;

The computer has done the subtracting for you, and figured out the answer.

Note: In an assignment, there is one variable on the left side of the equals sign, which is changed. Nothing on the right side (unless it is also on the left side, which will be discussed later) is changed.

See also:

StatementsAssignment of scalarsAssignment of listsArithmeticFunctions

Assignment of scalars

There are a few ways to assign a scalar. You can assign a scalar to a given value:

$NumberOfCats = 5;
$MyCatsName = "Zappy";

Or you can assign one variable using another:

$NumberOfNoses = $NumberOfPeople;

This tells the computer that the number of noses is the same as the number of people. Or, to put it another way, it takes the value stored in the variable NumberOfPeople, and stores a copy of it in $NumberOfNoses.

There are several things that you can do with a string. One useful thing you can do is concatenate two strings. For example, if you concatenate the strings “My cat’s name” and ” is Zappy.”, you get, “My cat’s name is Zappy.”

Did you notice the space between the quotation mark and the “is”? That space is important. Computers don’t know when you should add a space to separate words. If you concatenate “My cat’s name” and “is Zappy.” without the extra space, it would come out, “My cat’s nameis Zappy.”

In Perl, you can concatenate two strings by putting a period ('.') between them. For example, you could get the whole sentence like so:

$WholeSentence = "My cat's name" . " is Zappy.";

Or, to do it differently,

$FirstPartOfSentence = "My cat's name";
$SecondPartOfSentence = "is Zappy.";
$WholeSentence = $FirstPartOfSentence . " " . $SecondPartOfSentence;

Do you see what I did here? I didn’t have a space before “is” in SecondPartOfSentence, but I put another space in between the two parts. There were three strings here: $FirstPartOfSentence, ” ” (a string consisting of only a space), and $SecondPartOfSentence. I concatenated all of them together, just as you add 3 + 1 + 2 to get 6. Putting in an extra space can come in handy, when you want to make text look good.

There are other ways to assign scalars, and they will be covered when we discuss arithmetic and functions.

See also:

Variables in generalScalarsStatementsAssignment of variables in generalArithmeticAssignment of listsAssignment of hashesFunctions

Arithmetic

Perl, like many languages, lets you do arithmetic with numbers. You can have a statement like

$Average = ($FirstNumber + $SecondNumber + $ThirdNumber) / 3;

and the computer will do the arithmetic for you. It will add the three numbers, and divide the result by three. The result is stored in Average.

You may have noticed that I had parentheses — why are they necessary? This has to do with something called order of operations. Let’s say we want to figure out what 3 * 4 + 5 equals. Well, what do you do first — multiply 3 by four, or add 4 and 5? If you multiply first, then 3 * 4 = 12, so you have 12 + 5, or 17. So the expression equals 17. But what if you add first? Then 4 + 5 = 9, and 3 * 9 = 27, so we have 27. The number you get depends what you do first.

Parentheses are a way to tell the computer what to do first. Everything inside a pair of parentheses is calculated before everything outside of the pair of parentheses. Everything on an inside pair of parentheses is calculated before things on an outside pair of parentheses. So, for example, if we have (((3 * 4) + 6) / 9), that means that we first multiply 3 * 4 = 12, to get ((12 + 6) / 9); then we add 12 + 6 = 18, so we get (18 / 9), and then we divide 18 / 9 = 2, so we get a result of 2.

At least for now, you should always use parentheses to tell the computer what it should do first. Use parentheses, so that the computer knows exactly what order you want it to do things in.

Two notes:

First, if you ask it to do something that’s going to give a fraction (like “What is five divided by three?”), it will give a decimal for an answer. Usually, if there is a decimal involved in a calculation, the result will be a decimal. (With decimals, an answer will usually be a little more or a little less than it should be. That is a kind of error that happens with computers.)

Second, you can’t divide by zero. If you try to divide by zero, your program will stop running. It is good practice, before dividing by a variable, to make sure that it is not zero (see if-then).

It is generally good, when doing arithmetic calculations, to break them into as many small steps as possible. It is better to have several simple calculations than one really long and confusing one.

See also:

ScalarsAssignment of scalarsConditional clausesIf-then

Assignment of lists

There are a few ways to assign a list. One way is like this:

@MyFriends = ("John", "Susan", "Mary");

The list is assigned to something described by a left parenthesis ('('), some scalars separated by commas (','), a right parenthesis (')'), and then the semicolon (';'). You can use variables and numbers as well as just strings, like this:

@Numbers = ($LastNumber, 9);

You can also put everything that’s in one list, into another list. For example, you might write:

@PeopleIKnow = (@MyFamily, @MyFriends, "Jane", "Bob");

Then the list of people you know includes everybody in the lists of your family and friends, plus Jane and Bob.

One thing you will do often is to add one element to a list. Suppose you have a new friend named Fred, and you want to add him to your list of friends. You could do it this way:

@MyFriends = (@MyFriends, "Fred");

Now, I would like to answer a question you may have == how can MyFriends be equal to itself plus “Fred” added on to the end? That is like saying that a number equals itself plus one.

The answer is that the statement should be read like this: “Let the new value of MyFriends equal the old value of MyFriends, with “Fred” added at the end. It is possible, and useful at times, to use one variable on both sides of the equals sign ('=') in this way.

See also:

Variables in generalListsStatementsAssignment of variables in generalAssignment of scalarsAssignment of hashesFunctions

Assignment of hashes

Hashes may be assigned one of two ways: one of which remembles a scalar, and the other of which is like the assignment of a list.

Recall the earlier example where John, Sue, and Mary have a dog, a cat, and a goldfish respectively. The easiest way, and the one you should probably use most of the time (until you’ve outgrown this book), is to say, “John’s pet is a dog. Sue’s pet is a cat. Mary’s pet is a goldfish.” In Perl, we write it this way:

$Pet{"John"} = "dog";
$Pet{"Sue"} = "cat";
$Pet{"Mary"} = "goldfish";

Remember that $Pet{“John”} should be read as “John’s pet.” This means that the whole statement should be read, “Let John’s pet be a dog.” Even though the computer statement looks rather funny, it really says something that is fairly close to English.

The second way makes a bunch of assignments at once — it is useful when you want to create a hash from scratch. Creating the same hash this way would look like this:

%Pet = ("John" => "dog",
	"Sue"  => "cat",
	"Mary" => "goldfish");

Now, did you notice that the statement was broken over a few lines? It’s OK to split a statement over several lines and put spaces in to format it; indeed, it is good to do so. It makes the code more readable. This is called spacing.

See also:

Variables in generalHashesStatementsAssignment of variables in generalAssignment of scalarsAssignment of listsFunctions

Input and output

One important thing for programs to be able to do, is to be able to pay attention to what people say to them, and say things to people.

There are varying ways that programs do this; here, I will address a couple of the simpler ways. They both involve the keyboard. One reads a line in from the keyboard to a variable — that is, it reads in everything the user types, until he hits return — and the other prints out some specific text.

See also:

StatementsInputOutput

Input

The way I’m going to teach to do input, is as follows: Say that you want to input some line of text from the user, and store the result in the variable $UserResponse. The following two lines will accomplish that:

$UserResponse = <>;
chomp $UserResponse;

The first line reads a line into $UserResponse. But that includes the return character at the end of the line, which we generally don’t need. The second line takes the extra character off.

In general, you should use something like these two lines when you want to input a line from the user.

See also:

StatementsScalarsInput and OutputOutput

Output

The print statement is useful for output. Let me give an example of a very famous program:

#!/usr/local/bin/perl
print "Hello, world!\n";

The first line is a line you should put at the beginning of every Perl program you write. The second line prints, “Hello, world!” It is the second line we are studying.

What’s that funny “\n”? What does it mean? Well, Perl doesn’t know by itself when a line should end. So, we put “\n” at the end of each line, to tell it to go to the next line.

Here is another example of some code using print:

print "The average is " . $Average . ".\n";

Now, what does that all mean?

Remember that, earlier, when we talked about scalars, we could concatenate two strings by putting a period ('.') between them. This takes three strings: “The average is “, $Average, and “.\n”, and sticks them all together. Let’s say that $Average is 4.5. Then the result will look like:

The average is 4.5.

The “.” in “.\n” is just a period for the end of the sentence, and “\n” means the end of line.

See also:

StatementsScalarsInput and outputInput

Flow control

In many programming languages, there is a very powerful kind of statement called the goto statement. Quite often in programming, you are at one part of your code, the list of instructions, and you need to be somewhere else. So programmers would just put a goto in, and voila! you were at that other part of the program.

Well, gotos are very powerful, but they have a bit of a problem with them. If you just use gotos in the way that comes most naturally, the result is something called spaghetti code: the program just goes in and out in one tangled mess that’s impossible to understand, just like spaghetti. This results in code that’s full of bugs, that’s impossible to fix.

Therefore, it is in most cases strongly discouraged to use gotos. Gotos are considered hazardous to your health, and many programmers consider ‘goto’ to almost be a dirty word.

But wait. A goto is very powerful. If we’re going to say “no gotos”, shouldn’t there be something else to replace them?

And the answer, fortunately, is “Yes.” There are other ways to do almost anything that you would do with a goto — but do it better, and more cleanly. These ways make things much easier to understand, and have less bugs. The bugs that do get in are easier to fix.

There are two basic kinds of structures, that can do almost all of the work done with gotos — but do it much better. These two structures are called conditionals and loops, and we will explore them. There are also subroutines and functions, which will be covered later, and are also very powerful.

See also:

StatementsBlocksIf-thenIf-then-elseIf-then-else chainsLoopsForeach loopsWhile loopsFor loops

BlocksFor both conditionals and loops, it is useful to think of a cluster of statements taken together. A block of code begins with a left curly brace ('{'), and ends with a right curly brace ('}'). It should also be indented (have a margin on the left) by two to four spaces. It doesn’t matter how far you indent, but you should indent to the same depth most of the time. Here are a few statements by themselves:

print "Type something in: "; # The lack of a \n is intentional, so that the
                             # cursor stays on the same line.
$UserInput = <>;
chomp $UserInput;
print "You typed in " . $UserInput . ".\n";

Here is that same group of statements in a block:

    {
    print "Type something in: "; # The lack of a \n is intentional, so that
				 # the cursor stays on the same line.
    $UserInput = <>;
    chomp $UserInput;
    print "You typed in " . $UserInput . ".\n";
    }

In short, to make a block, you put a left curly brace before it, type in the statements in the block, and close with a right curly brace. The whole thing should be indented four spaces.

See also:

StatementsFlow controlIf-thenIf-then-elseIf-then-else chainsLoopsForeach loopsWhile loopsFor loopsFunctions

Conditional clauses

A conditional clause is something that is either true or false. The computer needs to be able to decide if something is true or false.

There are a number of different types of conditional clauses. The one which I will cover here, to get started with, is equals. An expression like:

($UserResponse == "y")

is an example of a conditional clause.

You can build up conditional clauses by using and, or, and not, as well as parentheses. Here is an example of a more complicated clause:

(($MyPet == "dog") || ($MyPet == "cat"))

You should always use lots of parentheses with conditionals, just like you should use parentheses in arithmetic. Furthermore, the parentheses have more or less the same meaning.

Now, I can see a question. Why did I use two equals signs instead of one? The answer is that Perl uses one equals sign for assignment, and two equals signs for conditionals. If you use one equals sign, Perl will think you are doing an assignment. For example, if you type:

($UserResponse = "y")

what that will do is assign $UserResponse the value “y”, instead of checking to see if $UserResponse is already “y”. This is a very easy mistake to make; check for this when your program seems not to work.

If-then clauses, and loops, do different things depending on whether something is true. A conditional clause is something that can be true or false, which Perl can use to decide if something is true, and therefore run if-thens and loops.

Scalars can also serve as conditional clauses. A scalar that has a value of 0, or that is an empty string (i.e. a string that doesn’t contain any characters, not even spaces — it would be represented as “”), is considered false. Any other scalar is considered true. In general, we use a 1 to represent true, and a 0 to represent false.

Note: Conditional clauses don’t have semicolons after them.

See also:

StatementsArithmeticFlow controlBlocksIf-thenIf-then-elseIf-then-else chains

If-then

Remember, back when we introduced statements, how we talked about going to a friend’s house? Let me reproduce the list of what to do:

Ask your parents for permission to visit your friend.
Call your friend’s house, and ask permission to come over.
Finish getting dressed.
Walk over to your friend’s house.
Take chewing gumm off of your shoe.
Greet your friend.
Play with your friend.
Eat a snack.
Play some more.
Say goodbye.
Walk home.
Take off your shoes.

Well, this list didn’t involve any decisions — and there are decisions involved. For example, you only continue over to your friend’s house if you get permission, right?

Let’s rewrite the list using if-then logic:

Ask your parents for permission to visit your friend.
If your parents give permission to visit your friend:
    {
    Call your friend's house, and ask permission to come over.
    If your friend's parents give permission to come over:
	{
	Finish getting dressed.
	Walk over to your friend's house.
	If you stepped on some chewing gum:
	    {
	    Take chewing gumm off of your shoe.
	    }
	Greet your friend.
	Play with your friend.
	Eat a snack.
	Play some more.
	Say goodbye.
	Walk home.
	Take off your shoes.
	}
    }

What we have here is a modified list of how to visit your friend, that only does things if they are appropriate — for example, it only goes over to your friend’s house if you have permission to go over.

The syntax in Perl for this sort of thing is as follows:

if (condition)
    {
    code to execute if condition is true
    }

“if” must be spelled exactly that way, with a lowercase 'i', and the curly braces put around the code to be executed. What Perl will do when it sees that, is see if the conditional clause is true, and if so, execute the block that’s inside the braces.

See also:

StatementsFlow controlBlocksConditional clausesIf-then-elseIf-then-else chains

If-then-elseSuppose that I want to do something in a programming language. Some pseudocode might be as follows:

if (I know how to do it)
    {
    do it;
    }
else
    {
    try to find out how to do it;
    }

There is one thing I want to do if the conditional clause is true, and another thing to do if the conditional clause is false. And that is done with this exact syntax:

if (conditional clause)
    {
    block of code to execute if the conditional clause is true
    }
else
    {
    block of code to execute if the conditional clause is false
    }

See also:

StatementsArithmeticFlow controlBlocksConditional clausesIf-thenIf-then-else chains

If-then-else chainsThere is one more step to be taken with if-then-else. That is demonstrated by the following segment of code:

if ($Pet == "dog")
    {
    print "Arf, arf!\n";
    }
elsif ($Pet == "cat")
    {
    print "Purr, purr!\n";
    }
elsif ($Pet == "goldfish")
    {
    print "Splish, splash!\n";
    }
else
    {
    print "I don't know what sound the pet makes.\n";
    }

Sometimes, you have more than two choices to deal with — there are more than two (or three) possibilities for a pet. An if-then-else chain is ideal for the following; the program checks if the first condition is true, and if the first condition is false, it checks if the second condition is true, and so on and so forth. The general syntax is:

if (first conditional clause)
    {
    code to be executed
    if first conditional clause is true
    }
elsif (second conditional clause)
    {
    code to be executed if first
    conditional clause is false, but
    second conditional clause is true
    }
...
elsif (last conditional clause)
    {
    code to be executed if all but the
    last conditional clauses are false, but
    the last conditional clause is true
    }
else
    {
    code to be executed if none of the
    conditional clauses are true.
    }

The final else is optional, but recommended.

See also:

StatementsArithmeticFlow controlBlocksConditional clausesIf-thenIf-then-else

Loops

A loop is what is executed when you want to run the same code for several different things. For example, here is some pseudocode to get bundled up in the winter:

while (there is more clothing to put on)
    {
    Select another item of clothing to put on.
    Pick it up.
    Put it on.
    }

There are different types of loops for different purposes.

See also:

StatementsFlow controlConditional clausesForeach loopsWhile loopsFor loops

Foreach loops

One useful kind of loop, does something to each element of a list. For example, here is how might might code getting bundled up to go outside in the winter to go sledding:

@WinterClothing = ("coat", "snowpants", "boots", "gloves", "scarf", "hat");
foreach $ArticleOfClothing (@WinterClothing)
    {
    print "I'm putting on my $ArticleOfClothing.\n";
    }

Before dissecting exactly how this loop works, let me show you what it does. It prints out:

I'm putting on my coat.
I'm putting on my snowpants.
I'm putting on my boots.
I'm putting on my gloves.
I'm putting on my scarf.
I'm putting on my hat.

There are a couple of things going on here.

First, we assign a list.

Then we go through the loop several times — each time, the variable $ArticleOfClothing is set to equal a different element of @WinterClothing, and the block of code is executed.

In that code, when Perl sees $ArticleOfClothing, it substitutes the value of $ArticleOfClothing (which may be “coat”, “snowpants”, etc.) for the name of the variable. So, the first time through, “I’m putting on my $ArticleOfClothing.\n” becomes “I’m putting on my coat.\n”, where “\n” tells Perl that that’s the end of the line.

Foreach loops should be used when you want to do something with every element of a list.

See also:

StatementsListsFlow controlBlocksLoopsWhile loopsFor loops

While loopsA while loop is a loop used to run a block of code while a condition is true. For example:

$ShouldContinue = "y";
$NumberOfTimesThroughLoop = 0;
while (not($ShouldContinue == "n"))
    {
    ++$NumberOfTimesThroughLoop;
    if ($NumberOfTimesThroughLoop == 1)
	{
	print "This loop has been executed $NumberOfTimesThroughLoop time.\n";
	}
    else
	{
	print "This loop has been executed $NumberOfTimesThroughLoop times.\n";
	}
    print "Go through the loop again(y/n)? ";
    $ShouldContinue = <>;
    chomp $ShouldContinue;
    }

Now, let’s look at what this code does.

$ShouldContinue tells if the loop should continue. “n”, for no, means to stop; anything else means to continue. So the loop says, “While we should continue”.

The variable $NumberOfTimesThroughLoop is initialized to 0 (set up to be equal to 0) before the loop begins. Then the first thing inside the loop, “++$NumberOfTimesThroughLoop;”, means to increase the value of $NumberOfTimesThroughLoop by one. In general, the expression:

++$variable name;

where variable name is the name of a “scalar” variable, means “Increase the value of variable name by one.”

Then we have a conditional. This conditional sees if it’s the first time through the loop. Why do we do that?

The statements inside the if clause (the block immediately following the if) and the else clause are almost identical — but there is an 's' after “time” in the else clause. This is so that, on the first time through, the program will print out:

This loop has been executed 1 time.

but on the second (third, fourth, etc.) time through, it will say something like:

This loop has been executed 2 times.

Then, after that, it asks the user if he wants to run through the loop again. After doing that, it reads a line of input into the variable $ShouldContinue — if the user types “y”, $ShouldContinue will contain a “y”, and if the user types “n”, $ShouldContinue will contain a “n”.

Then, after that, it checks if it should continue (the conditional clause right after the word “while”), and if it should, it executes the loop again.

See also:StatementsFlow controlBlocksConditional clausesIf-then-elseLoopsForeach loopsFor loops

For loops

A for loop is a special case of a while loop, which is commonly used for doing something a certain number of times.

Let’s suppose that I wanted to print “Hello, world!” ten times. I could just have ten lines like so:

print "Hello, world!\n";
print "Hello, world!\n";
print "Hello, world!\n";
print "Hello, world!\n";
print "Hello, world!\n";
print "Hello, world!\n";
print "Hello, world!\n";
print "Hello, world!\n";

But what if I wanted to change the number — to five or to fifty? It would take a lot of editing.

There’s a better way to do it, though. I could have the computer count up to ten, and each time print out “Hello, world!”. If I did that, then changing it to five or fifty would only mean changing the number I have to count to.

Let me give some code to do that, and explain what it does.

for($CurrentLine = 0; $CurrentLine < 10; ++$CurrentLine)
    {
    print "Hello, world!\n";
    }

That’s all the code that it takes. And what if I wanted to print “Hello, world!” a thousand times? A very easy change — only change the 10 to 1000:

for($CurrentLine = 0; $CurrentLine < 1000; ++$CurrentLine)
    {
    print "Hello, world!\n";
    }

Now, let me explain what it does. Let’s look at the first line. It has the following format:

for(part one; part two; part three)

It has three parts, separated by semicolons (';'). Each part does something different.

The first part is run exactly once. It is used to set things up — in this case, to assign the scalar variable the value of zero.

For reasons that you will understand later when you program, you should have computers start counting at 0. So, instead of counting from 1 to 10, this counts from 0 to 9 — and still does it ten times.

The second part is the conditional clause that is tested each time you run through the loop. In this case, it makes an arithmetic assertion: that CurrentLine is less than 10. After running through the loop, the computer checks to see if the second part is still true — if it’s true, the computer runs through the loop one more time.

The third part is something the computer does each time, after running through the loop and before checking the conditional clause. In this case, it increments (adds one to) the value of $CurrentLine.

So, all together, we have the computer counting from 0 to 9, and each time printing out a “Hello world!” message.

See also:

StatementsScalarsAssignment of scalarsArithmeticFlow controlBlocksConditional clausesLoopsForeach loopsWhile loops

Subroutines and functions

When you learned to walk, it was a bit tough to learn — but once you had learned once, you learned a way of walking that would take you anywhere (within certain bounds), on any kind of surface (within other bounds). You had learned walking in general, and so you didn’t need to learn to walk each time you met something new.

For computers, there are many things you’ll want to do a number of different times, in a number of different places — but it’s really only one thing. With subroutines and functions, you can write miniature programs that do one thing — and then you have a new command that is available to you, taking only one line, whenever you want to do something.

Subroutines are powerful. Subroutines are good. Whenever you find yourself doing the same thing in more than one place, it is probably good to put it in its own subroutine.

See also:

VariablesStatementsFLow controlBlocksArgumentsSubroutinesFunctions

ArgumentsSome subroutines and functions need information to do their job. For example, you might have a subroutine to tell the price for so many apples, so many oranges, and so many bananas — but first you need to tell it how many apples, oranges, and bananas there are, so it can calculate them!

That is done by giving the subroutine or function some arguments. The way you use a subroutine/function is to give an ampersand (‘&’) before the name of the subroutine/function, then its name, and then a list of arguments. For example, if we used the subroutine I mentioned, you might invoke it like this:

&TellPrice($NumberOfApples, $NumberOfOranges, $NumberOfBananas);

We’ll see exactly how to write such a subroutine here.

See also:

VariablesScalarsListsFlow controlSubroutines and functionsSubroutinesFunctions

Subroutines

A subroutine is a miniature program that you can run from within your program. Earlier, we talked about a procedure that would tell a price for an amount of fruit. Here is how we write such a procedure. Before the procedure is used, we assume that there is some code that tells the price of the different kinds of fruit:

$PricePerApple = .25;
$PricePerOrange = .30;
$PricePerBanana = .20;

And here is the subroutine itself:

sub TellPrice()
    {
    $NumberOfApples = shift(@_);
    $NumberOfOranges = shift(@_);
    $NumberOfBananas = shift(@_);
    @RemainingArguments = @_;
    $PriceForApples = $NumberOfApples * $PricePerApple;
    $PriceForOranges = $NumberOfOranges * $PricePerOrange;
    $PriceForBananas = $NumberOfBananas * $PricePerBanana;
    $TotalPrice = $PriceForApples + $PriceForOranges + $PriceForBananas;
    print "The total price for the fruit is $TotalPrice.\n";
    }

Well, let’s look at it piece by piece:

    $NumberOfApples = shift(@_);
    $NumberOfOranges = shift(@_);
    $NumberOfBananas = shift(@_);
    @RemainingArguments = @_;

This part finds out what the arguments to the procedure are, and stores them in the appropriate variables. This should go at the beginning of the subroutine; the syntax for using the subroutine is:

&TellPrice($NumberOfApples, $NumberOfOranges, $NumberOfBananas);

The part of the subroutine that gets the arguments should be of the following form:

    $first argument = shift(@_);
    $second argument = shift(@_);
    $third argument = shift(@_);
    ...
    @RemainingArguments = @_;

where first argument, second argument, and so on are the names of the arguments in order.

After firuging out what the arguments are, the subroutine then does some arithmetic to figure out the total price, and prints it out.

One more thing… At the beginning of the program, you need to declare your subroutine, by having a line like this:

sub &TellPrice();

See also:

StatementsFlow controlBlocksSubroutines and functionsArgumentsFunctions

Functions

One kind of useful subroutine is one that does some calculations, or something like that, and gives a value as an answer. For example, suppose we wanted to be able to assign the total price to a variable in our fruit market example. This is what functions are for.

To use a function, we would do something like this:

$TotalPrice = &CalculatePrice($NumberOfApples, $NumberOfOranges,
  $NumberOfBananas);

And the CalculatePrice function is almost exactly the same as the TellPrice procedure. Here is its listing, with all of the changes in bold:

sub CalculatePrice()
    {
    $NumberOfApples = shift(@_);
    $NumberOfOranges = shift(@_);
    $NumberOfBananas = shift(@_);
    @RemainingArguments = @_; 
    $PriceForApples = $NumberOfApples * $PricePerApple;
    $PriceForOranges = $NumberOfOranges * $PricePerOrange;
    $PriceForBananas = $NumberOfBananas * $PricePerBanana;
    $TotalPrice = $PriceForApples + $PriceForOranges + $PriceForBananas;
    return $TotalPrice;
    }

Now, instead of printing out the result, the subroutine returns it. Now the part of the program that called it (above) will have the result plugged in where it was given.

Another very useful function can be used to get a yes or no answer from the user. This subroutine doesn’t itself tell the user what he’s supposed to answer yes or no about; that would be done just before calling this subroutine.

sub confirm()
    {
    $UserAnswer = <>;  # Read in the user's answer.
    chomp $UserAnswer;
    if ((not($UserAnswer eq "n")) and # If it's not a yes or a no,
      (not($UserAnswer eq "y")) and
      (not($UserAnswer eq "N")) and
      (not($UserAnswer eq "Y")))
	{
	while ((not($UserAnswer eq "n")) and # Keep going until we get a yes
	  (not($UserAnswer eq "y")) and      # or a no.
	  (not($UserAnswer eq "N")) and
	  (not($UserAnswer eq "Y")))
	    {
	    print "Please answer \"y\", for yes, or \"n\", for no.\n";
	    $UserAnswer = <>;
	    chomp $UserAnswer;
	    }
	}
    # If we've gotten here, the user has given a yes or a no answer.
    return (($UserAnswer eq "Y") or ($UserAnswer eq "y"));
    }

This procedure makes sure that the user types a y or n, then returns a conditional that says that the user said yes. So, for example, one could have the following segment of code:

print "Do you wish to continue (y/n)? ";
if (&confirm())
    {
    print "Continuing...\n";
    }
else
    {
    print "Bye!\n";
    exit 0;
    }

That segment of code asks the user if he wants to continue. If he says yes, then the program says “Continuing…”, and continues. If he says no, the program says “Bye!”, and exits.

That’s all of the bare bones rudiments of programming. Now we can move onward to looking at a few sample programs, and then begin tinkering!

See also:

StatementsVariablesFlow controlBlocksSubroutines and functionsArgumentsSubroutines

Sample programs

Here, we will look at a couple of sample programs, to get an idea of how they tick — how one might put the pieces together to make something. What I have done is a lot like showing you a number of Lego blocks all by themselves — here is a hint on how you might put them together.

We will look at two programs — one that keeps track of your friends and their pets, and another that keeps a running average of numbers it is given.

I would like for you to read over them, see the explanations, understand them — and then see what you can do with them. Can you modify them? Can you build something else from scratch? Try it!

See also:

Friends and petsRunning average

Friends and pets

Here, we will have a program that asks you about you friends and pets, and remembers them for as long as it’s running. Let me give a listing. I am trying to document it well by putting in comments. Can you tell what it does? If you can’t, look up the parts you can’t understand.

#!/usr/bin/perl -w
#
# Friends and pets — a program to keep track of your friends and their pets.
#
# Last modified 12-29-01, by C.J.S. Hayward
#
# While you say you want to continue, it asks you for another friend's name,
# and then asks for the pet's name.  Then, it tells you all of the friends it's
# been told, and what their pets are.
#
# This is done with a while loop.
# The friends are stored in a list, and
# the pets are stored in a hash.
#
# We also use a couple of functions.
#

#
# The stuff it does in the beginning, called initialization.
#

# List the subroutines and functions.
sub Confirm();

#
# Confirm is a function that gets a yes or no answer from the user.
#
# Note that this function uses another function — ReadLine.  It is
# possible, and indeed very useful, to have one subroutine or function use
# other subroutines or functions.
#

sub Confirm()
    {
    $UserAnswer = &ReadLine();
    if ((not($UserAnswer eq "n")) and # If it's not a yes or a no,
      (not($UserAnswer eq "y")) and
      (not($UserAnswer eq "N")) and
      (not($UserAnswer eq "Y")))
        {
        while ((not($UserAnswer eq "n")) and # Keep going until we get a yes
          (not($UserAnswer eq "y")) and      # or a no.
          (not($UserAnswer eq "N")) and
          (not($UserAnswer eq "Y")))
            {
            print "Please answer \"y\", for yes, or \"n\", for no.\n";
	    $UserAnswer = &ReadLine();
            }
        }
    # If we've gotten here, the user has given a yes or a no answer.
    return (($UserAnswer eq "Y") or ($UserAnswer eq "y"));
    }

# Make the list of friends and hash of pets empty, so that they don't contain
# anything.
@Friends = ();
%Pets = ();

# Have scalars that we can use for true and false conditional clauses.
$True = 1;
$False = 0;

# Welcome the user to the program.
print "Welcome to the friends and pets program.\n";

$ShouldContinue = $True;

#
# The main loop.  This is where the meat of the program is.
#

while ($ShouldContinue)
    {

    # Read in the friend's name.
    print "Please enter the name of your friend:\n";
    $NewFriend = &ReadLine();

    # Add the new friend to the list.
    @Friends = (@Friends, $NewFriend);

    # Read in the friend's pet.
    print "Please enter the kind of pet $NewFriend has:\n";
    $NewPet = &ReadLine();

    # Add the new friend's pet to the list of hashes.
    $Pets{$NewFriend} = $NewPet;

    # Print a blank line, so that the output doesn't look too crowded:
    print "\n";

    # Now, recite the friends and their pets.
    foreach $CurrentFriend (@Friends)
	{
	$CurrentPet = $Pets{$CurrentFriend};
	print $CurrentFriend ."'s pet is a $CurrentPet.\n";
	}

    # Finally, ask the user if he wants to continue.
    print "Do you want to continue (y/n)?\n";
    $ShouldContinue = &Confirm();

    # And we reach the end of the loop.
    }


# If we get here in the program, the user does not want to continue.
# So, we say "Bye!", and leave.

print "Bye!\n";
exit 0;

#
# The program will never get here by itself, because it is after the exit
# statement.  But we can still put procedures and functions here.  We will put
# two functions here:
#

#
# ReadLine is a function that reads a line in, and gets rid of the trailing
# newline.  This does input exactly as specified earlier.
#

sub ReadLine()
    {
    $UserInput = <>;
    chomp $userinput;
    return $userinput;
    }

A sample output for this program might be:

Welcome to the friends and pets program.
Please enter the name of your friend:
Fred
Please enter the kind of pet Fred has:
furball

Fred's pet is a furball.
Do you want to continue (y/n)?
y
Please enter the name of your friend:
David
Please enter the kind of pet David has:
dog

Fred's pet is a furball.
David's pet is a dog.
Do you want to continue (y/n)?
n
Bye!

See also:

Sample programsRunning average

Running average

This program reads numbers and tells their running average:

#!/usr/bin/perl -w
$total = 0;
$number_of_items = 0;
$result = 0;
while(1) # 1 is always true.
    {
    print "Next item: ";
    $input_line = <>;
    chomp $input_line;
    $total = $total + $input_line;
    ++$number_of_items;
    $result = $total / $number_of_items;
    print "The average so far is " + $result + ".\n";
    }

See also:

Sample programsFriends and pets

Debugging

Do you have a little brother or sister? If you don’t, pretend you do—a brother, Fred, who’s just barely old enough to walk.

Imagine that your mother tells your brother to go to the bathroom. So your brother walks to the bathroom, stands there a while, and then asks why he was sent there. Or imagine that you have a potted plant in the house, and your parents come home and find that your brother dug out dirt from the tree and is playing in the dirt. They clean up the mess and explain, very plainly, that he is not to play in dirt. So your brother tries to find something better, and pulls all the leaves off the plant and plays in the leaves.

Computers are like that. They don’t understand what you mean—only the literal sense of what you said. If you say almost exactly what you mean, the computer will almost do what you mean, and the ‘almost’ can be very annoying. In this chapter, I’ll explain how to fix common bugs, and close with how science can help you debug.

Common Bugs

Many common bugs come from one of two sources:

  1. Accidentally typing the wrong thing.
  2. Logical errors.

Logical and mathematical errors are things like being off by one. Subsequent sections will tell you something about typing errors.

Syntax errors

If a programming book tells you to write something a certain way, you should do exactly what you’re told. If you’re told to write:

@a=(1,2);
foreach $b (@a)
    {
	print $b;
    }

and you write:

@a=(1,2);
foreach b (@a)
    {
	print $b;
    }

What will happen?

Something different, and not what you want.

One dollar sign is missing, so the computer will do something different, and not what you want.

Can’t the computer just do what you mean?

No. Knowing what you mean shows human intelligence, and the computer can’t do it.

What happens quite often is that you write something a little different than what you thought—something a person wouldn’t notice—but the computer can’t correct. If you’re having trouble, read your code closely to see that you typed exactly what you thought you typed.

Misspelling

What happens if you type:

$pizzas = 12;
print "$pizzzas\n";

What you’d like to happen is that it prints out the number 12. However, I put an extra 'z' in, so it prints out 0. Why? The variable $pizzas may be 12, but $pizzzas is a different variable, and it is not twelve.

If you’re having trouble, make sure that every variable and function is spelled exactly the same way every time it appears.

Forgotten semicolon

What happens if you type the following line of code:

print "Hello, world!\n"

What you’d like is for it to print “Hello, world!”. However, the program will crash. It’s waiting for a semicolon, and if it’s not there it’ll get confused. Make sure that every line, unless you’ve been told it doesn’t need a semicolon, has a semicolon.

Single and Double Equals

What happens if you run the following code:

$a = 1;
$b = 2;
if ($a = $b)
	{
	print "They're equal!";
	}
else
	{
	print "They're not equal.";
	}

What would you like to happen? It compares 1 and 2 and says that they’re not equal. However, if you run this, it says that they’re equal. Why? ($a = $b) says to make a equal to b. What we wanted was ($a == $b), which would compare them.

Use '=' to assign a value and '==' to compare. It’s easy to use the wrong one and introduce bugs to your program.

Scientific Debugging

How does the scientific method work?

In a nutshell, there’s something a scientist doesn’t understand, so he makes a guess, and then makes a way to show if the guess is wrong. After a lot of testing, a guess that hasn’t been shown wrong may become part of science.

When you don’t understand something, making guesses and then testing them (“If my program’s miscalculating, then the variables before this part will have the right values, but the variables after will have wrong values. I know! I’ll put print statements before and after to tell me the variables’ values”) can help you see why your program’s not functioning.

If you have a science teacher who programs computers, it would be very helpful to approach him sometime when he’s not busy and ask, “How can the scientific method help me debug computer programs?”

Conclusion

I hope this has helped you to begin to tinker and play, exploring what your computer can do when you speak one of its languages. When you’re ready to learn more, read good programming books, continue asking questions, and by all means, keep tinkering!

Would you like another book that will tell you more? O’Reilly publishes excellent titles. Learning Perl is an excellent next step. When you’ve outgrown that, Programming Perl, affectionately named the camel book by Perl programmers, will take you far.

And if you enjoyed this, would you like to see some of what else I’ve written? You might find some of it interesting.

-Jonathan

Glossary

Argument
Assignment
Atgry
Block
Bug
Code
Comma
Comment
Concatenate
Conditional clause
Dollar sign
Equals sign
Feature
Flow control
Function
Hash
Input
Language
Left curly brace
Left parenthesis
List
Loop
Output
Percent sign
Pound sign
Right curly brace
Right parenthesis
Scalar
Semicolon
Statement
String
Subroutine
Underscore
Value
Variable

[Certain terms are defined in the text; those remaining are:]

Definition: Atgry

An atgry (the plural of atgry is atgrynge) looks like this:

@

Atgrynge are used before variables that are lists. They are also known as ‘at signs’.

Definition: Bug

A bug is a mistake in a program that makes the program act differently than it was supposed to.

Bugs are one of the facts of life in computer programming; we all make mistakes, and figuring out and fixing bugs is an important part of creating programs.

The term ‘bug’ comes a story that, way back in the middle bronze age when computers were made with physical relays, a computer wasn’t doing something properly, and (after investigation) the people discovered that there was an insect which had gotten into the computer and was making it malfunction: the computer had a bug in it. Since then, we use the word ‘bug’ to refer to malfunctions that are caused by human mistakes as well as funny things like insects crawling into a computer.

Even when it seems like you’ve done everything right, sometimes the computer still won’t do what you want it to. One of the points of maturity for a programmer is not to blame other things, but to realize that it’s probably a mistake you’ve made, and to see what you need to do to fix it.

Definition: Code

Code is a word we use to refer to the “stuff” a program is made out of, just as ‘wood’ is a word we use to refer to the “stuff” a board is made out of. Here is an example of code:

#!/usr/local/bin/perl
#
# Print out the phrase "Hello, world!"
#

print "Hello, world!\n";

In this case, this code is all of a program; code can also be some of a program.

Can you identify the different parts of this program?

Definition: Comma

A comma looks like this:

,

Definition: Concatenate

When you concatenate two strings, you stick them both together, one after the other. For example:

If you concatenate:

"Old MacDonald had a farm. "

and

"On that farm, there was a cat. "

the result is,

"Old MacDonald had a farm. On that farm, there was a cat."

In Perl, you can concatenate strings by placing a period (‘.‘) in between them. The following code assigns $first_part the value "Old MacDonald had a farm.", $second_part the value "On that farm, there was a cat. " before assigning the concatenated value to $combined:

$first_part = "Old MacDonald had a farm. ";
$second_part = "On that farm, there was a cat. ";
$combined = $first_part . $second_part;

Definition: Dollar sign

A dollar sign looks like this:

$It is used before the names of some variables — specifically, scalars, and (in some cases) hashes.

Definition: Equals sign

An equals sign looks like this:

=It is used for assignment.

Definition: Feature

A feature is some capability of a program, something that it can do. For example, most word processors can have bold or italic text, and print things out. Some time spent working on programs is adding new features.

There is a running joke among computer people, that when there’s a bug that a customer discovers, the technical support people say, “Oh, you’ve discovered our new feature!” — they pretend the bug is really a special feature.

Definition: Hash

A hash looks like this:

#

Hashes are used in Perl to begin comments, and are also known as pound signs.

Definition: Language

There are different languages that humans use to communicate with each other — English, French, German, Italian, and so on. There are also languages for humans to tell computers to do things. Perl is one of many such languages.

Different computer languages have different strengths and weaknesses. Each one has a slightly different function — just like the tools in a tool chest (hammer, pliers, screwdriver, etc.) have different functions.

There is a difference between computer and human languages, which is this: Human languages are difficult to learn, at least for adults. Even if you can communicate well in English, you will have to work hard to be able to communicate even badly in French or German (if you have not already had experience with them). But with computer languages, once you have really learned to program, learning a new language is fairly easy.

This is part of why I am using Perl as the language for this book, instead of using the language I know best (C). Perl is a good, easy language to begin with, and I hope both that you can learn Perl, and move on to other languages that will teach you other things that Perl doesn’t teach you very well. I think, for example, that Java is a good second language. After Perl and Java, you should be able to use almost any language.

Definition: Left curly brace

A left curly brace looks like this:

{

Left and right curly braces are used to enclose blocks of code, as well as designate an element of a hash.

Definition: Left Parenthesis

A left parenthesis (the plural of parenthesis is parentheses) looks like this:

(

Left and right parentheses are used to clarify what you mean in certain arithmetic expressions, as well as telling where the members of a list and the arguments to a function begin and end.

Definition: Percent sign

A percent sign looks like this:

%

Percent signs, among other things, are used to refer to hashes.

Definition: Period

A period looks like this:

.

Periods are used, among other things, to concatenate two strings, as explained in the section of the text on scalars.

Definition: Right curly brace

A right curly brace looks like this:

}

Right and left curly braces are used to enclose blocks of code, as well as designate an element of a hash.

Definition: Right parenthesis

A right parenthesis (the plural of parenthesis is parentheses) looks like this:

)

Right and left parentheses are used to clarify what you mean in certain arithmetic expressions, as well as telling where the members of a list and the arguments to a function begin and end.

Definition: Semicolon

A semicolon looks like this:

;

Semicolons are used at the end of most statements.

Definition: String

A string is some amount of text. Examples of strings are:

"My left foot"

"436"

"A man without eyes,
saw plums in a tree.
He neither ate them nor left them;
now, how could this be?"

We enclose a string in quotation marks, to indicate where the string begins and ends. The quotation marks are not actually part of the string. (Strings can contain almost anything, including line breaks and even quotation marks — although you have to be careful with quotation marks so you don’t confuse the computer.)

Definition: Underscore An underscore looks like this:_Note that it is lower than a hyphen: here is a hyphen, followed by an underscore: -_.

Underscores, as well as letters and numbers, may be used in the names of variables and functions.

Definition: Value

A value is a specific meaning that a variable may have at once. For example, the scalar $NumberOfCats could have the value 1, 2, or 5. A variable may only have one value at a time; when it is given a new value, the new value replaces the old value. Here are some examples of values that a scalar may have:

"five of spades"

1

-2.5

Tinkering With Perl is a free book that provides an introduction to programming in Perl, as well as a basic reference for things like foreach in Perl, if-then, and if-then-else, in addition to providing a glossary where you can find definitions for concatenate and other terms.

Tinkering With Perl may be one of the most popular offerings on this site, but it’s not the only attraction. You can read a tongue-in-cheek Game Review: Meatspace, read an even more offbeat customer service survey (whether or not you actually fill it out), and spend a few minutes wishing your boss would read, The Administrator Who Cried, “Important!” (Not to mention that there are other things you can read here besides tech stuff, from Janra Ball: The Headache to The Spectacles.)

The Case for Uncreative Web Design

Usability for Hackers: Developers, Anthropology, and Making Software More Usable

Usability, the Soul of Python: An Introduction to Programming Python Through the Eyes of Usability

Within the Steel Orb