4.0253 Recursive Fiction (1/211)

Elaine Brennan & Allen Renear (EDITORS@BROWNVM.BITNET)
Mon, 9 Jul 90 15:47:37 EDT

Humanist Discussion Group, Vol. 4, No. 0253. Monday, 9 Jul 1990.

Date: Thu, 5 Jul 90 19:36:03 -0500
From: Alan D Corre <corre@csd4.csd.uwm.edu>
Subject: Recursive Fiction

There has recently been some discussion about interactive fiction on
this group. I should like to speak of recursive fiction, which I
discovered a few years ago, and of which I have written the first (and
possibly the last) example. It came about thus. The fine editor used
on the Apple II Pascal system, written by Ken Bowles of UCSD, has two
modes, either of which may be TRUE or FALSE. The setting FILLING=TRUE
and AUTOINDENT=FALSE is appropriate for normal text like this, since it
avoids constant carriage returns. The setting FILLING=FALSE and
AUTOINDENT=TRUE is appropriate for writing Pascal programs, where each
successive indentation is continued until canceled. The setting
FILLING=FALSE and AUTOINDENT=FALSE is appropriate for columnar output
which would be spoiled by filling. This leaves one possibility (both
TRUE) for which there appears to be no use whatsoever. Now the Midrash
(you all know about Midrash) Genesis Rabba 10.5 declares expressly
that "even the things that you view as superfluous in the world" are
part of the generality of creation and hence have a function. This, it
declares, includes fleas, gnats and flies, imagine! And spotted owls.
The thought is repeated in at least three other places (Leviticus Rabba
22.2, Numbers Rabba 18.22 and Ecclesiastes Rabbati 5.8.2.) Accordingly,
it became a challenge to find SOME use for FILLING=TRUE and

Now the LISP programming language likes to use recursion rather than
iteration for repetitive actions. Maybe I should explain recursion,
which is a concept with an eerie feel about it, as though one was
entering a hall of mirrors. Using Icon, which also supports recursion,
but is a little easier to follow than LISP, I will give you an
example, will give you an example, give you an example, you an
example, an example, example,. (sic--or sick, if you prefer, but
please note the comma before the period.) Consider the following

procedure recurse(phrase,n)
if n > 0 then {
writes(phrase) }

Let's substitute "Hi there!" for phrase and 2 for n and see what
happens. The procedure first checks if n is greater than zero. Since
it is, we enter the curly brackets. But now the procedure calls
itself, so we have to enter the second call of the procedure before we
can finish the first. In this call, the value of n is 1, because n has
been reduced by 1. Lo and behold, it calls the procedure a third time.
This time the value of n is 0, so the curly brackets are skipped. The
call of the procedure concludes, having done--precisely nothing. But it
finished, and that is important. Another proof of the truth of our
Midrash. This lazy call serves just by standing and waiting. At this
point the second call of the procedure can be finished, but since this
continues INSIDE the curly brackets it writes out "Hi there!". Since
it then finishes, the first call can be finished and writes out "Hi
there!" again. There is now no unfinished business, and we are
through. And we have performed a repetitive action without an
iterative loop. We selected the number two, but these calls can go on for-
ever, or until the memory runs out of space, whichever comes first.
(The computer has to "remember" all these uncompleted calls.) On the
computer on which I am writing, I found that I could call this
procedure 219 times. If I dare to go 220, the machines blows its
stack, and in effect tells me that if I want to do that I had better buy
the next 128K of memory.

LISP programs generally represent the "depth" of the recursion by
increasing indentation on the page. The constant decrementation which
helps ensure that the program will end after 2, or 219 calls is
represented by continually beheading a list of linked items, rather
than by whittling an integer down to zero. When this list becomes of
zero length--the words you see between the comma and period above--the
program ends. The head of the list is mystically referred to as its
CAR. Somehow we have got used to the idea of zero, but an empty list
is still strange. Can you imagine going to the supermarket with a
shopping list consisting of nothing? But centuries ago zero must have
given people the same feeling. And maybe we should shop occasionally
with an explicit empty list; it is quite economical, and perfectly
logical. Computers are tolerant of insanity, and maybe can teach us
mortals a lesson.

Recursion provided the key to a use for the two trues. If I wrote a
recursive story, I could use filling for the story and autoindent for
the depth of recursion. And that is what I did. If you use the EMACS
editor, you can turn on the auto-indent and auto-fill modes
simultaneously to achieve a similar effect. I called my story
The Friends of Gerry
A Recursive Parable
Gerry sat down at the counter of his favorite bar, and
ordered a double apple juice. The bartender handed him his
drink, and he sat quietly contemplating it. Suddenly he
noticed a beautiful young woman sitting nearby. She was
physically perfect in every detail. He admired her blonde
hair and hazel eyes. Her ample bosom gave promise of
pneumatic bliss. Her slender legs were draped around the bar
stool naturally and expressively. Gerry turned to her and
said: "Would it be a thin to have a drink with me?" (Gerry
always lisped when he was nervous.) She agreed with a sweet
smile. Gerry put out his hand and touched her elbow lightly.
She did not flinch or scowl, but looked at him calmly and
confidently. "I think we can be friends," said Gerry. "So do
I," replied the girl, and she impulsively grasped his hand.
Just as she did so, Gerry noticed another young woman who
had come in. She resembled the first young
woman so closely that Gerry could hardly
believe it, but there was one crucial
difference--she was headless. Gerry found
himself wondering why this inspired no dread
in him, and how she managed to smile at him
when she had no head. He found himself
thinking of the Cheshire cat in 'Alice,' who
disappeared leaving only his smile behind.
"That was different," he concluded. "After
all, the Cheshire cat had a head to start
with, and yet.." He got up abruptly, leaving
his beautiful companion with no sense of
loss. "Would it be a thin to have a drink.."
he essayed. Like the first woman, she agreed
readily, and explained to him that she had
stopped in for some light refreshment
because she had lost her car. Gerry
expressed his regret and concern, but she
shrugged it off with a gesture of
resignation. "In an environment like this,
what else can you expect?" she said. Gerry
was puzzled by this comment because he had
no awareness of being in a bad neighborhood.
On the contrary, he had heard that it was
full of intellectuals and pilots without a
flight plan. "Why am I so attracted to a
headless woman who has lost her car?" he
asked himself in some puzzlement. He bent
forward and touched her elbow. "I think we
can be.." he began, but as he finished the
sentence, he noticed another woman come in
and sit down, and he hardly heard the
response to his remark.
He got up and moved towards
the new patron, noticing as
he did so that she was merely
a waist and a pair of legs.
Despite her deficiencies,
she still, to his surprise,
seemed perfect in every detail,
just as attractive as her
predecessors. "Would it be
a.." he began. Gerry felt a
little foolish. "Why don't I
try a new line?" he thought.
"Those other women must be
listening and thinking what
a bore I am." Yet somehow he
realized that the line was
working, and it would be
foolish to change. Touching
her elbow presented no
difficulty to Gerry,
although he could not under_
stand why it did not, seeing
that she was, so to speak,
only part of a woman. As he
moved his hand along her arm
he was dis_
tracted by a
new visitor.
This woman,
perfect and
beautiful as
the rest, in_
spired in him
a sense of
which he had
not felt be_
fore. "No
hair, no
bosom, no
legs," he
said to him_
self. "Why,
she isn't
ALL!" None_
theless, he
could not
resist her
the waist and
the legs that
had so en_
chanted him
he addressed
his newest
love. "Would
it.." he
began. But
Gerry got no
further. The
smell of
was in the
air, and his
dissolved in
a flash of
blazing l