From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,502eafcf316bcb10,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-12-12 00:53:45 PST Newsgroups: comp.lang.ada Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!swiss.ans.net!news.dfn.de!zeus.rbi.informatik.uni-frankfurt.de!terra.wiwi.uni-frankfurt.de!news.th-darmstadt.de!News.Uni-Marburg.DE!news.belwue.de!news.uni-ulm.de!rz.uni-karlsruhe.de!darum.uni-mannheim.de!fht-mannheim!roxi.rz.fht-mannheim.de!duz From: duz@roxi.rz.fht-mannheim.de (Dirk Zoller) Subject: Ada can't initialize (aggregate) array of length 1? Sender: news@roxi.rz.fht-mannheim.de (NEWS - system account) Organization: Fachhochschule fuer Technik, Mannheim (FRG) Date: Mon, 12 Dec 94 08:12:30 CET X-Newsreader: TIN [version 1.2 PL2] Message-ID: <1994Dec12.081230.24978@roxi.rz.fht-mannheim.de> Date: 1994-12-12T08:12:30+01:00 List-Id: Hello, yesterday I ran accross the following problem. Trying to write a little tetris game as an excercise in Ada programming I wanted to initialize an array of arrays of char i.e. the different shapes of stones. Not being sure about the aggregate syntax I experimented with an array of length 1 as a start. This didn't work, not for the wrong aggregate syntax (which is similar enough to C) but because of the array length 1. Simplified I did this: type stone is array (1..2) of character; shapes: constant array (1..1) of stone := ("[]"); ____________________________________________^ At this point I got an error message about type stone expected. When using two stones, it works: shapes: constant array (1..2) of stone := ("[]", "{}"); I further simplified it to this: type t1 is array (1..1) of integer; v1: constant t1 := (1234); didn't work with the message aggregates of length 1 were not allowed. Why? My books don't seem to know about (mention) this peculiarity. I use gnat 2.0 on OS/2. Dirk --- duz@roxi.rz.fht-mannheim.de The world is switching from the 'computers are magical, programmers are magicians' to 'computer=TV+typewriter+fax+telephone' --- Will Baguhn