Path: news.daimi.aau.dk!not-for-mail From: Wilfried Rupflin Newsgroups: comp.lang.beta Subject: Re: Multidimensional Repetitions (arrays) Date: Wed, 11 Dec 1996 18:57:27 +0100 (MET) Organization: DAIMI, Computer Science Dept. at Aarhus University Lines: 56 Approved: mailtonews@daimi.aau.dk Distribution: world Message-ID: <199612111757.SAA05886@mjolner.mjolner.dk> Reply-To: Wilfried Rupflin NNTP-Posting-Host: daimi.daimi.aau.dk Xref: news.daimi.aau.dk comp.lang.beta:10906 >Hello All, > >I'm looking for a smart way to implement multideminsional arrays in >beta. Is there a smart way to do that or is it necessary to use a >1-dimensional repitition and make a map function of some kind? > >In other words I'm looking for something like this: > >\begin{not proper beta Syntax} > > twoDimRep : [10][5] ^integerObject; >.. > &integerObject[]->twoDimRep[3][3][]; > 5->twoDimRep[3][3]; > >\end{not proper beta Syntax} > > >How can I code something like that in _legal_ Beta? Small pieces of >code, refs to FAQ's or other ressources would be highly appreciated :) > >Regards, >Michael Hoehle I've got another -- rather primitive -- solution that should work as desired in simple cases: (# twoDimRep: [10]@ (# row: [5] ^integerObject; #); do &integerObject[]->twoDimRep[3].row[3][]; 5->twoDimRep[3].row[3]; #) Of course, this works with static references too: (# twoDimRep: [10]@ (# row: [5] @integer; #); do 5->twoDimRep[3].row[3]; #) Regards Wilfried Rupflin