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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,c908d18110a09ea4 X-Google-Attributes: gid103376,public From: johnherro@aol.com (John Herro) Subject: Re: Supplying a parameter for "digits" Date: 1996/08/19 Message-ID: <4v9mud$nad@newsbf02.news.aol.com>#1/1 X-Deja-AN: 175074900 sender: root@newsbf02.news.aol.com references: <4url7g$j6f@goanna.cs.rmit.edu.au> organization: America Online, Inc. (1-800-827-6364) newsgroups: comp.lang.ada Date: 1996-08-19T00:00:00+00:00 List-Id: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) would like to write > generic > type Coord is digits <>; > type Value is digits <>; > package Example is > type Product is > digits Integer'Max(Coord'Digits, Value'Digits); but the last line quoted won't compile because the expression isn't static. I don't have the answer, but I can shed a *little* light on the subject. It would *seem* from 4.9(1) that anything that can be evaluated at compile time "should" be considered a static expression. However, the forms that actually *are* considered static expressions are listed in 4.9(2) through 4.9(13). Unfortunately, what you want to write isn't on the list. I have to admit, though, that (6) and (7) come tantalizingly close. Last January there was a thread here about the expression A(0), where A is a *constant* array. You would certainly think that A(0) "ought" to be a static expression, but it isn't. Of course, a smart compiler might evaluate A(0) at compile time and use the result in optimizations, but unfortunately it still doesn't count as a static expression for the rules of Ada syntax. The only rationale mentioned in the earlier thread is that they "had to draw the line somewhere" (in terms of how complex an expression could be considered static). They drew it in 4.9(2) through 4.9(13). Unfortunately, I don't know how to set up your generic package the way you want. Anyone have any ideas? - John Herro Software Innovations Technology http://members.aol.com/AdaTutor ftp://members.aol.com/AdaTutor