[Inquiry] Re: Theme One Program -- Commentary Notes

Jon Awbrey jawbrey at oakland.edu
Tue Mar 18 20:32:24 CST 2003


o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o

TOP.  Commentary Note 11

o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o

Knab.

Knab is a function from texts and modes to (texts and) integers.
Mode is a data type with three possible values:  null, moot, firm.
If the argument mode is null, then the functional value of Knab is 0,
otherwise Knab gets its functional value by reading a numerical input
from the argument text file.

function knab (var thou: text;
                   what: mode): numb;
begin
 if what = null then knab := 0 else knab := nip (thou)
end;

(5222)(7562)

o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o

Spin.

Spin is a function from texts and ideas to (texts and) ideas.
Whatever the case, whether the argument idea is nil or non-nil,
the functional value of Spin is set equal to the argument idea.
However, if the argument idea is non-nil and therefore points to
existing form, Spin causes the integer value in the 'code' field
of this form to be written out to the argument text file.

function spin (var thou: text;
                   this: idea): idea;
begin
 spin := this;
 if this <> nil then write (thou, this^.code)
end;

(5223)(7563)

o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o

Score.

Score is a function from texts, integers, and ideas
to (texts and) ideas.  It gives a "formatted output"
version of Spin that is convenient for column output.
The functional value of Score is always set equal to
the argument idea, whether this is a nil idea or not.
If the argument idea is non-nil, and thus refers to
an existing form, Score causes the integer value in
the 'code' field of this form to be written out to
the argument text file, right justified in a text
field of width equal to the integer argument.

function score (var thou: text;
                    span: numb;
                    this: idea): idea;
begin
 score := this;
 if this <> nil then write (thou, this^.code : span)
end;

(5224)(7564)

o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o

Pose.

Pose is a function from texts and ideas to (texts and) ideas.
In every case its functional value is equal to the argument idea,
nil or non-nil, but if the argument idea indexes an existing form,
then Pose causes the contents of the 'sign' and the 'code' fields
of the indicated form to be written out to the argument text file.

function pose (var thou: text;
                   this: idea): idea;
begin
 pose := this;
 if this <> nil then write (thou, this^.sign, this^.code, blank)
end;

(5225)(7565)

o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o~~~~~~~~~o




More information about the Inquiry mailing list