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

Jon Awbrey jawbrey at oakland.edu
Tue Mar 18 17:12:14 CST 2003


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

TOP.  Commentary Note 6

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

Just a few more perfunctory functions to dispense with
before we get down to something a bit more interesting.

At.

function at (row, col: numb;
                 this: idea): idea;
begin
 at := this;  gotoxy (col, row)
end;

This is a function from pairs of integers and ideas to ideas that
acts as the identity on the input idea and has a side-effect of
placing the cursor at the row and column of the screen display
that is specified by the given pair of integers.

(5205)(7545)

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

Check.

function check (this: idea): idea;
begin
 check := this;  write (memavail, ' bytes')
end;

This is a function from ideas to ideas
that acts as the identity on the input,
with the side-effect of writing out to
the screen display the number bytes of
memory that are available in the heap.

(5206)(7546)

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

Memcheck.

function memcheck (this: idea): idea;
begin
 memcheck := at (1, 48, this);
 write ('< free memory : ', memavail : 8, ' bytes >')
end;

This is a function from ideas to ideas
that acts as the identity on the input,
with the side-effect of writing out to
the screen display the number bytes of
memory that are available in the heap.

This performs the same function as Check,
but formats the output value and displays
it at a particular location on the screen.

(5207)(7547)

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




More information about the Inquiry mailing list