[Inquiry] Re: Theme One Program -- Commentary
Jon Awbrey
jawbrey at att.net
Tue Jan 18 13:34:36 CST 2005
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
TOP. Commentary Note 4
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Flint.
function flint (this: idea): idea;
var here: idea;
This is the declaration head of the function Flint,
declaring it as a function from ideas to ideas and
declaring a local variable "here" of the type idea.
Flint is the main repeating block of the program.
What it does will be described much further below,
when we come to the corresponding definition body.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Next comes a rather large number of low level input-output functions.
These have the form of "transformations of ideas with side-effects".
In other words, they are defined to have the type of functions from
ideas to ideas, but the main purpose of calling them is to perform
some other useful action in passing.
Hold.
function hold (this: idea): idea;
begin
hold := this; stop
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect of calling the Stop
procedure, defined above, that prompts
the user for some keypress to continue.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Wait.
function wait (this: idea): idea;
begin
wait := this; delay (256)
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect to delay the action
for about a quarter of a second.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Dim.
function dim (this: idea): idea;
begin
dim := this; video (moot)
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect to "moot" the video
color of the characters that will next
be displayed on the screen.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Vid.
function vid (this: idea): idea;
begin
vid := this; video (firm)
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect to "firm" the video
color of the characters that will next
be displayed on the screen.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Dash.
function dash (this: idea): idea;
begin
dash := this; clreol
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect to clear the screen
from the cursor to the end of the line.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Lash.
function lash (this: idea): idea;
begin
lash := this; write (enter)
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect to write a carriage
return character.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
Quash.
function quash (this: idea): idea;
begin
quash := dash (lash (this))
end;
This is a function from ideas to ideas,
that acts as the identity on the input,
with a side-effect to write a carriage
return character and then to clear the
screen to the end of the line of text.
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
inquiry e-lab: http://stderr.org/pipermail/inquiry/
o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o
More information about the Inquiry
mailing list