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

Jon Awbrey jawbrey at att.net
Wed Jan 19 14:36:03 CST 2005


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

TOP.  Commentary Note 24

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

Switch.

Switch is a special constructor that
uses the special constructor Bud and
the generic constructor Peg to build
an idea-form structure of this shape:

                   o-------o
         o---------|---o   |
         |   o-----o   |   |
         o-->| ) 0 |---o   |
             o-----o       |
             ^             |
      switch |             |
             |             |
   o---------|---o         |
   |   o-----o   |         |
   o-->| ( 0 |---o         |
       o-----o<------------o

Observe that the idea returned as the functional value
is directed toward the form with the right parenthesis.

function switch: idea;
var here: idea;
begin
 here := bud (links);
 with here^ do
  begin
   on := peg (right, nil, nil, here, nil, 0);
   on^.by := on;
   here := on
  end;
 switch := here
end;

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