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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b47b15fda2aeb0b2 X-Google-Attributes: gid103376,public From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) Subject: Re: Two ideas for the next Ada Standard Date: 1996/09/10 Message-ID: <5137hi$9oq@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 179647980 references: <50aao3$3r88@news-s01.ny.us.ibm.net> <50gelc$2le@goanna.cs.rmit.edu.au> <50jk0f$krh@goanna.cs.rmit.edu.au> <50opma$kos@goanna.cs.rmit.edu.au> organization: Comp Sci, RMIT, Melbourne, Australia nntp-posting-user: ok newsgroups: comp.lang.ada Date: 1996-09-10T00:00:00+00:00 List-Id: dewar@cs.nyu.edu (Robert Dewar) writes: >Richard, you can't quite do 100% of what you want, since you cannot exclude >attributes like Image, but you are obviously missing an important capability >in Aa 95. > type x is range 1..10; > function "+" (a,b : x) return x is abstract; >causes the addition operator to be unavailable for this type. >This is how weakening is done in Ada 95. I had actually seen this in a thread earlier this year. (comp.lang.ada _is_ such good value.) However, 'Image is one of the things that would merit suppression: it would be nice to export an enumeration type _as_ an enumeration type without having to provide all the names as strings. So far the only way I've been able to figure out of exporting some of the enumeration literals of an enumeration type is package foo is type T is private; function X return T; function Z return T; private type T is (X, Y, Z, W); end foo; At least, I _thought_ it should work. Enumeration literals are parameterless functions returning values of the type, not so? But gnat says that the declarations of X and Z in the private part _conflict_ with the earlier declarations (instead of, as I thought, matching them), and who am I to argue? My reaction to this was not to look through the standard for the fine print explaining why I can't do it this way, but to stop trying. Exporting half an enumeration type is probably too silly. -- Australian citizen since 14 August 1996. *Now* I can vote the xxxs out! Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.