Path: news.cs.au.dk!noatun.mjolner.dk!mail-to-news From: Atle Newsgroups: comp.lang.beta Subject: Containers Date: Mon, 13 Nov 2000 15:02:14 +0100 Organization: Posted to comp.lang.beta by a mailtonews script Lines: 43 Sender: lbr@mjolner.dk Approved: mailtonews@cs.au.dk Message-ID: <8uoobk$6ne5g$1@gjallar.cs.au.dk> NNTP-Posting-Host: bifrost.mjolner.dk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: gjallar.cs.au.dk 974120116 7059632 130.225.8.27 (13 Nov 2000 12:55:16 GMT) X-Complaints-To: usenet@cs.au.dk NNTP-Posting-Date: Mon, 13 Nov 2000 12:55:16 +0000 (UTC) Mailing-List: contact usergroup-help@mjolner.dk; run by ezmlm X-No-Archive: yes X-Mailer: Mozilla 4.72 [en] (X11; U; Linux 2.2.14 i686) X-Accept-Language: en X-Original-Message-ID: <3A0FF466.94021F55@skynet.be> X-Original-Sender: atle@skynet.be Xref: news.cs.au.dk comp.lang.beta:12642 Thanks for the explanation on the & operator. gbeta interests me, I take an operating system course starting January, it would be fun to make gbeta into an OS, like Oberon :-) Now, I have a much more trivial question. This is what I want to do: ArrayOfStuff: (# r: [1]@Stuff; Nr:@INTEGER; indexOf:(# ENTER Stuff[] DO ... EXIT Inx #); objectAt:(# ENTER Inx DO ... EXIT Stuff[] #); add: remove: #); If I only needed one, I might just cook up an 'array' like this one. But now I see I need 4 of five of them. I have a particular need: The objectAt: method is rarely used, since the array is not a real array, it is a 'manager' - it takes an ID, looks up the corresponding record in a statical table and stores the whole record. It will then delivere parts of that record in response to getText: or getField:(# ENTER (ID, FieldName) ... #) As an example, it takes the Diagnosis ID 407a as input, it will then look up a complete description of this diagnosis and store it (in r above). This diagnosis has a field 'Explanation' - I then imagine a method like this: getExplanation: (# t: @TEXT; ID:@TEXT; DO ... (ID,'Explanation')->StuffArray.getField->t; #) Could one of you quickly give me an eaxmple of how to use a generic container for this? Thanks, Atle