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=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ba5a88c05a7ac9bb X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-04-25 10:58:25 PST Path: archiver1.google.com!news1.google.com!news.glorb.com!border1.nntp.ash.giganews.com!nntp.giganews.com!newshosting.com!nx01.iad01.newshosting.com!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!news.iks-jena.de!not-for-mail From: Lutz Donnerhacke Newsgroups: comp.lang.ada Subject: Re: Problem with anonymous arrays Date: Sun, 25 Apr 2004 17:58:24 +0000 (UTC) Organization: IKS GmbH Jena Message-ID: References: NNTP-Posting-Host: belenus.iks-jena.de X-Trace: branwen.iks-jena.de 1082915904 1543 217.17.192.34 (25 Apr 2004 17:58:24 GMT) X-Complaints-To: usenet@iks-jena.de NNTP-Posting-Date: Sun, 25 Apr 2004 17:58:24 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:7476 Date: 2004-04-25T17:58:24+00:00 List-Id: * Delf wrote: > entry EnterGiratoire (I: Integer) when NbCarsOnRP = 0 or (NbCarsOnRP > 0 > and NbCarsOnRP < MAXCARS and I = WhoCanPass) is > > But gnatmake says: Giratoire.adb:35:109: "I" is undefined I is defined AFTER the guard is passed. If you like to access parameters TO the guard you have to use entry families: type Family is range 1 .. 16; protected type XXX is entry EnterGiratoire(Family)(other: Parameter); end XXX; protected body XXX is entry EnterGiratoire(for I in Family)(other : Parameter) when ... I = WhoCanPass is begin ... end EnterGiratoire; end XXX; Please note, that entry families can be instantiated as separate procedures for each possible value of the family parameter. So the usable range of values is limited. GNAT allows the whole Integer range, but fails miserably in instantiating with Storage_Error.