Higher-Order Perl

Purchase Higher-Order Perl online from Barnes & Noble

A Note About The Cover

The pictures on the cover are significant for two reasons.

Around 1994 I started dating a woman who was a quilter. Quilting is a traditional American craft in which the quilter takes small scraps of fabric and sews them together into patches, then sews the patches into blocks. Eventually the blocks are assembled into a quilt top, which is sandwiched with some stuffing to make the complete quilt. The layers of the sandwich are sewn together, with the stitching forming patterns; this stitching is the actual quilting.

Quilts are like programs in some ways. They are built up from smaller bits that work together. The programs in this book are even more like quilts, because this book is about building programs from prefabricated standard parts and by plugging variations into stock patterns.

There are many traditional designs for quilt blocks, with colorful names like Flying Geese, Corn and Beans, Broken Dishes, Log Cabin, Courthouse Steps, Underground Railroad, Bear Claw, and so on. But after seeing a lot of quilts and pictures of quilts, it occurred to me that there might be a lot of block designs that nobody used, and that perhaps had never been seen.

I was curious about this, and also I wanted to impress my new girlfriend, so I wrote a suite of Perl programs to generate all the quilt blocks of a certain type: sixteen "half-square triangle" patches arranged into a square with 90-degree rotational symmetry, and printed out the result:

(I made a mistake in my output; one block appears twice. Can you find the duplicate?)

I was delighted, because the results confirmed my suspicions: there are a lot of excellent but rarely-seen quilt blocks.

The cover of the book shows the development of one of these blocks, starting from the half-square triangle patch, then four such patches joined together, then a complete block with 90-degree rotational symmetry, and then a larger piece formed by joining four blocks together. This reminds me of the way the functions in this book take functions as inputs and use them as components in larger and more complicated assemblages.

I was even more delighted when the quilter and I got married. She made the program output into a real quilt and gave it to me as a wedding present. There are pictures here.

The other reason that the cover pictures are significant is that since my original goal in writing the programs was to impress my girlfriend, the cover pictures are therefore part of the output of the most successful Perl programs I've ever written. I wish all my programs achieved their design goals so spectacularly.

Return to: Universe of Discourse main page | What's new page | Perl Paraphernalia | Higher-Order Perl