[Oberon] FPGA - DIY Dialogs

Tomas Kral thomas.kral at email.cz
Fri Jan 18 21:57:20 CET 2019


On Fri, 18 Jan 2019 09:34:40 +0100
Jörg <joerg.straube at iaeth.ch> wrote:

> When shuffling pointers a quick drawing of the list, the objects
> involved and their pointers next and prev helps a lot

I am now considering this,

  PROCEDURE Remove*(id: INTEGER);
    VAR o: Object;
  BEGIN o := ThisId(id); IF o # NIL THEN o.id := 0 END
  END Remove;

versus that

  PROCEDURE Remove*(id: INTEGER);
    VAR o: Object;
  BEGIN o := ThisId(id);
    IF o # NIL THEN
      IF first = last THEN first := NIL; last := NIL
      ELSIF o = last THEN o.prev.next := NIL; last := o.prev
      ELSIF o = first THEN o.next.prev := NIL; first := o.next
      ELSE o.prev.next := o.next; o.next.prev := o.prev
      END ;
      Out.String("Removing "); Out.Int(id, 3); Out.Ln
    END
  END Remove;

-- 
Tomas Kral <thomas.kral at email.cz>


More information about the Oberon mailing list