Path: news.daimi.aau.dk!news-feed.inet.tele.dk!mr.net!www.nntp.primenet.com!nntp.primenet.com!news.mathworks.com!fu-berlin.de!zrz.TU-Berlin.DE!news From: Kai Petzke Newsgroups: comp.lang.beta Subject: Re: Multidimensional Repetitions (arrays) Date: Wed, 11 Dec 1996 16:05:15 +0100 Organization: Technical University Berlin, Germany Lines: 38 Message-ID: <32AECDAB.41C6@idefix.physik.tu-berlin.de> References: NNTP-Posting-Host: foxylady.physik.tu-berlin.de Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 2.0 (X11; I; IRIX 5.2 IP20) Xref: news.daimi.aau.dk comp.lang.beta:10905 Michael Hoehle wrote: > > 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? One possible solution is to use a set of objects at the first level: (# lev1: (# r: [5] ^integerObject #); twoDimRep: [10] ^lev1; do (* init rep *) (for i:10 repeat &lev1[]->twoDimRep[i] for); &integerObject[]->twoDimRep[3].r[3][]; 5->twoDimRep[3].r[3]; #); > > 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