[Oberon] How to mimic an associative array

Duke Normandin dukeofperl at ml1.net
Sun Dec 5 13:58:34 CET 2010


On Sat, 4 Dec 2010, Douglas G. Danforth wrote:

> Folks,
>
> Does one want an associative 'array' or just an association?
> If one can associate two things x:y and retrieve one of them
> given the other then the implementation doesn't matter as
> long as it is efficient.

I think that I've found a solution that will work for me - a simple
linked list.

TYPE
 String* = ARRAY ?? OF CHAR;

 Form = POINTER TO Cell;
 Cell = RECORD
      key: String;
      value: ARRAY ?? OF CHAR;
 END;


That will give me _lots_ of practise using O-2 arrays, pointers and
records.

Thanks for your and other's constructive and helpful input. It was
much appreciated! Merry Christmas!! everybody ...
-- 
Duke



More information about the Oberon mailing list