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

Jon Awbrey jawbrey at oakland.edu
Mon Mar 17 11:41:07 CST 2003


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

TOP.  Commentary Note 2

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

The main thing to get out of the declaration section
is the definition of the 'idea' and 'form' data types,
at Par 5182.

{ compiler: turbo pascal, version 5.0, }
{ (c) 1987, 1988 borland international }
{$M 53248,0,655360} { stack and heap   }
{$B+} { boolean complete evaluation on }

(5176)(7516)

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

{ project: theme
  segment: learner + modeler                         copyright: 1984 - 2002
  version: 1                                                by: jon awbrey }

(5177)(7517)

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

Theme.

program theme;

(5178)(7518)

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

uses    crt;

(5179)(7519)

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

const   links = '(' ;  right = ')' ;  enter = ^m ;  ender = ^z ;
        comma = ',' ;  point = '.' ;  estab = ^i ;  escap = ^[ ;
        blank = ' ' ;  quote = '`' ;  elide = ^h ;  erase = ^x ;
        aster = '*' ;  minus = '-' ;  empty = "" ;    nul = #0 ;

(5180)(7520)

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

type    mode = (null, moot, firm);
        cast = set of char;
        numb = 0..maxint;
        info = string;

(5181)(7521)

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

        idea = ^form;
        form = record
                sign: char;
                as, up, on, by: idea;
                code: numb
               end;

These are the principal data types of the Theme program.

An 'idea' is a pointer to a 'form'.

A 'form' is a record consisting of:

1.  A 'sign' of type char;

2.  Four pointers, 'as', 'up', 'on', 'by', of type idea;

3.  A 'code' of type numb, that is, an integer in [0, max integer].

Represented in terms of 'digraphs', or directed graphs,
the combination of an 'idea' pointer and a 'form' record
is most easily pictured as an 'arc', or a directed edge,
leading to a 'node' that is labeled with the other data,
in this case, a letter and a number, the other arcs out
of the node in question being kept in mind implicitly.

At the roughest but quickest level of detail,
an 'idea' of a 'form' can be drawn like this:

   o a 1
   ^
   |
   @

When it is necessary to fill in more detail,
the following schematic pattern can be used:

 ^ ^     ^
as\|up on|
   o-----o by
   | a 1 |--->
   o-----o
   ^
   |
   @

(5182)(7522)

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

var     here: idea;
        size,
        trim: numb;
         con: text;

(5183)(7523)

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




More information about the Inquiry mailing list