Lisp Fundamentals

NOTE: for all my non-computer friends and readers. If technical topics bother you or make you tense, perhaps todays post is not for you. If you are not given cold sweats when facing a new topic with the flavor of computers or programming, by all means please join me.

There are many things that Lisp, the programming language does right. It never ceases to amaze me and I am going to once again take a few minutes to discuss exactly what some of these things are and why they are so important.

Lisp was not originally conceived of as a programming language. It was invented by John Backus as a notation to enable discussion about Alonzo Church’s lambda calculus.

Lisp is characterized by the structure of its expressions, called forms. The simplest of these is the atom. An atom is a singular symbol or literal and represents a value. For instance, 42 is a numeric literal whose value is the number 42. Similarly, “Hello, world!” is a string literal that represents itself as its value. There are also symbols, which are strings of unquoted characters that are used as fundamental elements of Lisp. There are rules for how a valid symbol is form but for now it is sufficient to know that a symbol starts with a letter and then is composed of zero or more additional characters that can be either a letter, a number, or one of a collection of certain punctuation characters. Since the exact list of other characters varies among the dialects of Lisp, we will leave them unspecified at present.

The other type of form is a list. A list is comprised of a left parenthesis followed by zero or more forms and ending in a right parenthesis. Notice I said forms instead of symbols. The implication here is that you can have lists embedded in other lists as deeply nested as you like. This proves to be an interesting trait as we will soon see.

There is one more fundamentally interesting aspect of Lisp. That is that in a typical Lisp form the first element in a list after the left parenthesis is taken to be an operator. The subsequent elements in the list are considered arguments. The operator is either a function, a macro, or a special form. Macros and special forms, while extremely important and interesting are beyond the scope of this discussion.

That leaves us the operator as function. A typical Lisp function form is evaluated as follows. The first element is examined to determine what kind of form the list is. If it is a function, the rest of the arguments in the list are evaluated and collected in a list and the function is applied to them. If another list is encountered as one of the arguments, it is evaluated in exactly the same way.

For example, consider the expression (+ 4 (* 8 7) (/ (-26 8) 9)). The first operator is +. + is a symbol bound to the function that represents addition. The second item in the list is 4. It is a number that represents itself. The next element in the list is the list (* 8 7). When evaluated, the 8 and 7 are arguments to *, the multiplication function and the value returned by that function is 56. The final element in the top level list is (/ (- 26 8) 9). The / is taken as the division function and is applied to the evaluation of (- 26 8) which is the subtraction function that returns 18. When you divide 18 by 9. you get the value 2. Thus the top level argument list  consists of 4, 56, and 2. When you add all three of those numbers you get 62 which is the value that the expression ultimately returns.

This simple mathematical expression illustrates another fundamental aspect of Lisp. It is expressed as a list form which, given a set of bindings to arithmetic functions expresses a simple program. This identical representation of both data and programming in Lisp, called homoiconicity by the way, is at the heart of much of Lisp’s power. Since Lisp’s programs are indistinguishable from Lisp’s data, they can be manipulated by Lisp programs to great advantage.

Think of it like this. Lisp can, in some sense, think about how it is thinking and modify it as it desires. This is why artificial intelligence investigators like using Lisp so much, it is so similar to the simplified models of intelligence that they are building that the boundary begins to blur.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Something for Nothing… and Chicks for Free

I am reading a book entitled Imager by L. E. Modesitt, Jr. It is the first book in a series of ten books so far. The premise is that there are certain people in this fantasy world that can manifest things just by thinking about them. It is a wonderful story so far (I’m about a third of the way into the first book). It has gotten me to think about some parallels between the Imagers in that world and programmers in ours.

What does a programmer do if not bring forth a creation solely from his or her mind. And it is more than just a story, although I shudder when I say just a story considering how much I have struggled writing fiction myself. My point though is that programs often have a utilitarian function. They enable us to do things that we couldn’t do without them. Never mind that a program doesn’t have a physical existence, per se. One that can be seen and touched. But it does have perceptible effects upon the world, whether it is on a display screen or in some physical process that it controls through a digital interface.

In the books, Imagurs walked a fine line between being useful to those that didn’t share their gift, and being killed out of fear of what they might do with their awesome talents. Although people don’t fear software developers now, I can see a not so distant future in which they do. And with fear comes persecution.

We need to start teaching our apprentice programmers a code of ethics and holding them to it. If people don’t trust programmers, we stand to face problems over that mistrust, sooner than later. When people realize the power that programmers wield in today’s digital world we better be prepare to allay their fears.

By the way, I highly recommend the book. It is riveting. I’m already looking forward to getting the next volume in the series.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Groovy! Far Out! Namaste!

I signed up for the test drive of brain.fm. It is a web site that purports to help you focus, meditate, or sleep via music tailored to effect your brain state. I of course signed up for focus. I have often complained that I was having trouble concentrating when I was trying to write, either my morning journal entry or my blog post. I have to report that since I started listening to it right before I started writing this blog post, I have managed to focus on writing it, despite the show on the television. I am wearing headphones.

The music is what might be termed high energy space music, where space music refers to the kind of music played on Hearts of Space. There is a kind of a warble that underlies the somewhat arbitrary melody and driving rhythm. I quite like it. It is varied enough to be interesting without being so complex to distract. I think they’ve accomplished their goal here. I am curious about the meditation track and the sleep induction track.

In the mean time since I am so focused, I intend to take advantage of my state of mind to write a little bit longer post. It will be entirely impromptu due to the fact that I didn’t give it any thought prior to starting to write. To tell the truth, most of my blog posts are written this way. I have some vague idea and I start to riff on it. If I generate questions to which I don’t off the top of my head know the answer, I stop and look them up.

Lately though, I’ve been somewhat agitated and I haven’t followed up with research as much as I would like. It was all I could do just to throw the ideas out there without expending the effort to look up the specific details or studies to support my assertions. This bothered me, but not enough that I did anything about it.

I have studied so called entrainment in the past. The idea is that the brain produces electromagnetic waves at specific frequencies that have been correlated with the subject’s state of mind. The categories of brain waves have been given names from the Greek alphabet, for instance alpha waves, beta waves, delta waves, and theta waves. Each group corresponds to a state of mind.

Studies have been done that indicate that musical content can nudge the brain into one or another of these states. It has been compared to the phenomena where two electronic signals are of nearly the same frequency and one is held rigidly steadfast, the other will drift toward it until they are in unison. This is termed entrainment. I believe this is probably behind the music at brain.fm.

So, I just took a break and went and read on the brain.fm web site about the the science behind their product. It is in fact based on the entrainment research. I think I’m going to give it a try. I would like to be able to get more done when I’m working, sleep more effectively when I’m sleeping, and meditate better when I am meditating. I am not sure about the $150 lifetime program yet but I think $48 for a year is not unreasonable. If I renew my subscription in a year, I may opt for the lifetime plan.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

The Sleep Habits of the North American Homo sapiens

Changing one’s sleep habits is a bitch, not to put too fine a point on it. I recently changed assignments at work and my new group tends to work from approximately 7:30am until around 4:00pm. I’m not required to work those hours but in the spirit of being a team player, I have been working on shifting my circadian rhythm.

I have been getting up early for several years now. I spend the time getting bathed and dressed, doing chores around the house, talking with my wife, taking my dogs for their morning walk, and writing a thousand words in my journal. In order to get all that in and get to the office around 9:00am, I was getting up at 5:30am.

In order to attempt to get to work around 8:00am, I have started getting up at 4:30am. But things aren’t that simple. Getting up an hour earlier means getting to bed an hour earlier, unless I intend to subsist on an hour less sleep a night. I soon discovered that I can’t do with an hour less sleep. Furthermore, I discovered that when I get up at 4:30am, even if I go to bed at 9:00pm instead of 10:00pm, I am not as alert as I am at 5:30am.

This makes it more difficult for me to write in my journal. I find myself nodding off while I’m trying to write. And when I am managing to stay awake, my thought processes aren’t as lively as they are when I get up at 5:30am. This has been slowly improving but I still find myself tired in the morning, tired in the evening when I’m trying to write my blog post, and even tired mid afternoon, around 3:00pm.

I also find that I’m struggling to get anything else done besides my bare minimum routine. I expect it will continue to get better as I keep practicing and my circadian rhythm slowly shifts. Of course when we spring forward, I’ll have to go through this process all over again. I hope everyone gets a good night sleep and wakes up refreshed. I’m certainly going to give it my best try.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Growing Pains

When I was in high school Alvin Toffler published a book entitled Future Shock. In it he described a condition that resulted from too much change too fast. The fact is, the amount of and acceleration in the rate of change has continued to grow in the fifty years since Toffler did his study. Future shock has become more and more acute.

Ray Kurzweil studied the rate of change in his book The Singularity is Near. It turns out that no matter which dimension of technological change you measure they all are growing at an exponential rate. If you plot an exponential curve you discover that it goes up at an ever increasing rate until it reaches the point where it spikes to infinity.

Unless something constrains it from continuing to grow at that rate. Like for instance the laws of physics. Or, in the case of social and economic change, the ability of human beings to adapt to change. For millennia the fundamental rate of change that people had to deal with was measured in centuries for the most part.

And the number of things that were changing was few at any one time. You had one or two innovators per generation. Today we have thousands of innovators in any given field of endeavor. Add to that instant access to all that technical knowledge on the internet and we’re in for a hell of a roller coaster ride.

We went from an industrial based economy, to a service based economy, and most recently to an information based economy. We have enough resources that everyone in the world could live like royalty but instead we are at the mercy of the one percent that have concentrated control of 99 percent of the wealth. Things look grim.

Except for one saving fact. This minority can only get away with what we let them get away with. We have to take an active role in electing representatives and senators that will put our interests first. We have to work together to become the change that we want to see.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Don’t Let It Get You Down

“Winter is coming.”

So goes the motto of the Stark house in George R. R. Martin’s Game of Thrones. I feel a great impending doom facing the world. I’m not sure what is going to happen or what indications have tipped me off. I hope to goodness that I am wrong. But just for argument’s sake, what if I’m right?

How much would it take to topple civilization? The bulk of the population is dependent on a fragile infrastructure for clean water, food, and power. We have seen what a short disruption in power can do to our city. On April 27, 2011 a super outbreak of 362 tornadoes swept through Alabama doing nine billion dollars worth of damage and leaving Huntsville and much of North Alabama without power only to be slowly restored starting May first.

The affected area was relatively small. Many people were able to drive to Atlanta or Nashville or other unaffected places until power was restored. But what would happen if the entire country was affected? What if there was a coronal mass ejection that knocked out all electrical and electronic devices in the world? How long would it be before people were starving and rioting?

So, I’m feeling depressed tonight. I am wondering what I can do to help change the world into a less dangerous place. A place that is less prone to slide into barbarism at the stroke of disaster, natural or man made. I hope we never find out first hand the answer to any of these ominous questions.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Theater is in My Blood

My father was a school teacher. He taught English and Speech and Theater. He was a good teacher. He was a consummate professional. But the thing that made his soul sing was directing theatrical productions. When he was in college his plan was to prepare himself for a career in New York on Broadway. He tailored his degree so that he would have the credentials necessary to obtain a teaching certificate.

When he graduated from college, he gave his degree to his father and told him “There you go.” He had gotten the teaching degree to show his father that he could do it. He was drafted soon after that and sent to post Korean War Germany. He was assigned to headquarters company of a training battalion and ended up directing a touring special services variety show that played various American military installations in Europe.

When he got out of the Army, he returned to school studying for a masters degree in Theater. Only now he had a wife and baby boy. He found a position teaching in a High School in Waterloo, Illinois. The next year he took a job Junior High School in Springfield Illinois. After a couple of years there, he was offered a position at Paducah Tilghman High School in Paducah, Kentucky.

He had always done plays at the schools where he taught but Tilghman gave him the opportunity to mount high quality theatrical productions with a school population large enough to supply enough talented actors to pull it off. I remember He produced everything from Shakespeare to musicals. It was a magical time. It got into my blood.

When I was eight and nine, I was an extra in a summer stock musical titled “Stars In My Crown”. I played one of Job’s children in his production of Archibald MacCleish’s J.B. when I was in fourth grade. In sixth and seventh grade, a friend and I performed a one act play in several talent shows.

I was active in high school plays throughout my high school career. And then when I graduated from High School I got a job at Guntown Mountain in Cave City, Kentucky. I was a gunfighter and I played guitar in the saloon show. The next summer I did the same thing at Kaintuck Territory in Aurora, Kentucky near Kentucky Lake. The next summer I was back at Guntown Mountain for my last season in western theme parks.

It has been forty years since I have been a professional actor but it is still in my blood. I think I would love to do it again. I enjoy performing, whether it is playing the guitar of acting on the stage or in videos. Perhaps I should act upon this urge. My father found a way to integrate his dream into his professional life. Perhaps I can circle back to my theatrical origins.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Musical Musings

Music affects me profoundly. I am primarily moved by the notes themselves. I often find that I neglect to pay attention to the lyrics. It’s not that I don’t enjoy the lyrics. It’s just that the music overwhelms me.

I used to have the excuse that I couldn’t understand the lyrics in most of the songs that I like. That was a combination of lower audio standards in the recording studio and poorer performance of home stereo equipment.

Digital audio has changed all that. Today’s digital audio is so clear that if you close your eyes when you are listening to it you can easily get the impression that the musicians were standing in the room with you.

I had that experience on a couple of occasions earlier in my life but they were when I listened to the incredibly expensive (from my perspective anyway) analog stereo systems that some of my barracks rat friends owned when I was in the Army. And why not? They didn’t have anything else to spend their money on. The had a roof over their heads, three hot meals a day, health care, and a generous salary considering what they actually had to do from day to day.

Granted, we were subject to being asked to put our lives on the line for our country at the drop of a hat. But, there weren’t any hot wars in progress at the time and the Cold War was waining. There were these proto-terrorist jerks that called themselves the Bader-Meinhoff gang but the Polizei had them on the run.

Meanwhile, we went camping in the snow, played spades for days on end while waiting for headquarters to send a truck to drag our broken down test van back to post. We slept in our arctic sleeping bags in the van in temperatures that felt ten degrees colder than the snow covered forest outside.

Music was the common thread that helped us preserve some shred of our humanity through it all. When I finally got a decent audio system, built in to my computer as it turns out, it was no surprise that it turned out to be one of the primary uses that I put my computer to.

The internet has added the mechanism for distributing music so efficiently that the artists can now claim much more of the income that they generate from their recordings. This has encouraged more people to sell their music online and increase the diversity of music available.

Not all musicians feel that way. Some feel like they are losing out on sales because of people pirating their music. I can appreciate their point but I think they would find that the people that pirate their music weren’t going to buy it in the first place. They play the music for their friends and by virtue of the fact that more people hear their music to begin with, they sell more than they would have without internet sales.

I don’t have statistics to back that up but I do see more artists releasing more music than ever before. It is recorded in higher fidelity, is relatively cheaper for the consumer, and the artist doesn’t have to give 85 to 90 percent of their revenue to a record company. Your mileage may vary.

And just to be clear, I’m not advocating piracy. I pay for my music. I buy more music now than I ever have. I also enjoy it more.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

Don’t Read This Post

They have done studies recently that concluded that sleep deprivation is as bad as, if not worse than, alcohol when it comes to impairment. Given that I got up at four thirty this morning and it is ten forty five as I write this post I guess I’m guilty of impaired blogging. I have been racking my brain trying to think of something to write about. I kept coming up with nothing. I felt the pressure of the midnight hour approaching. I started thinking about how tired I was.

That was when it hit me. I needed an Uber or a Lift for writers. We can’t very well have people writing blog posts when they are impaired now, can we? That’s my story and I’m sticking to it. So I’ll post this pitiful excuse for a blog post and call it a night. Tomorrow’s Saturday and I’ll get plenty of sleep and write a better post. Remember, friends don’t let friends blog when their sleep deprived. Oh, and don’t read this post.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.

The World is Just One Big Simulation

I have this pet theory. It is feasible, if not likely. It’s that the universe is just a very high fidelity simulation. If that is, in fact, the case, as several credible philosophers have asserted, it would be easy to explain luck. Whoever writes the code for the simulation determines how luck works. It might be totally random, or it might be that the programmer picks out individuals that he or she wants to be lucky and stacks the deck in their favor.

I sometimes feel like I am one of those people that have been chosen by the programmer, or God, or whatever other mechanism it is that is behind luck. I have had so many great opportunities. Things have come fairly easily to me. I was always good at taking tests so I didn’t have to study hard in school to make good grades. Whenever I needed a job, there was an interesting one waiting for me, and it involved doing things that I wanted to do anyway. I didn’t have to pound the pavement job hunting. I had friends that knew about jobs that were available.

But after a lifetime of things being relatively easy, I have discovered something that I want to do that I have to struggle to accomplish. And what is more important, I find that it means more to me when I do manage to pull it off than all the other things that came so easily.

I’m talking of course about writing. And even though it is one of the hardest things that I’ve ever done, when I stop and think about it, it is so much easier to write now than it ever has been before. There are computers that make typesetting so easy that even a caveman can do it. No wait, that’s another essay entirely.

We have spelling checkers and grammar checkers. You still are on your own when it comes to picking which homonym is appropriate to say what you mean to say but even in that case we have dictionary.com, thesaurus.com, and a bunch of other sites available to us via that great information appliance that we call the internet.

The one thing that is still hard is deciding what to write about. I have learned that it is important that I write about something that I find interesting. That doesn’t make it much easier. I am interested in so many different things.

I struggle with distractions. The TV is the biggest distraction, followed closely by the internet. I take the latter to include email, instant messaging, and the greatest time suck of all, the world wide web. The days of struggling all afternoon trying to remember the name of the actor that played that character that you loved so much in that obscure moving that only you seem to remember are over. These days we have IMDB to settle arguments about who played what in which film or tv show. And what research librarian can compete with the instant gratification of Google?

And I haven’t even mentioned cell phones or self driving cars yet. When I am honest, all I really have to do to think of something interesting to write about is to relax and think about how lucky I am to live in such a miraculous time in history. Or maybe it’s just the imagination of that programmer that makes all of the luck.


Sweet dreams, don’t forget to tell the ones you love that you love them, and most important of all, be kind.