[Inquiry] Re: Theme One Program -- Commentary
Jon Awbrey
jawbrey at att.net
Tue Jan 18 14:00:04 CST 2005
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.
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.
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.
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