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

Jon Awbrey jawbrey at att.net
Tue Feb 1 14:16:16 CST 2005


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

TOP.  Commentary Note 51

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

Like.

Like is a function from pairs of ideas to ideas that serves as
a specialized search operation, working on the premiss that its
second argument idea, if significant, points to a form in a cycle
of forms.  Its functional value is nil unless that cycle contains
a form that Apes the form indicated by the first argument idea,
in which case the address of the matching form is returned as
the functional value.

The following figure illustrates one case of successful search:

                 o-----------------------------------------o
     o---o       |   o---o   o---o         o---o   o---o   |
     | m |       o-->| a |-->| b |-->···-->| m |-->| n |---o
     o---o           o---o   o---o         o---o   o---o
     ^               ^                     ^
that |          this |                     | like (that, this)
     @               @                     @

function like (that, this: idea): idea;
var here, there: idea;
begin
 here := nil;
 if this <> nil then
  begin
   there := this;
   repeat here := apes (that, there);
    there := next (there)
   until (here <> nil) or (there = this)
  end;
 like := 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