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-Thread: 103376,cd45439466e86f24 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.zanker.org!news.cs.univ-paris8.fr!informatik.uni-bremen.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: enumeration type Date: Mon, 27 Sep 2004 14:19:03 +0000 (UTC) Organization: GMUGHDU Message-ID: References: NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1096294743 14003 134.91.1.34 (27 Sep 2004 14:19:03 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Mon, 27 Sep 2004 14:19:03 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:4268 Date: 2004-09-27T14:19:03+00:00 List-Id: Dmitry A. Kazakov wrote: :> If you don't dislike writing down what you want to say, :> you can use qualified notation: :> if b = Boolean'(True) and v = Ternary_Logical'(True) then : What for? Rick asked, "How can I now access the True-element from the original Standard.Boolean type?" Then, sometimes it is not necessary to stress that v is of type Ternary_Logical or b of type Boolean, or to mention True at all as in Peter Hermann's example. Sometimes added qualification helps (me) understanding the software if there is some redundant type information, because it reduces the need to look at context. For example, if your function returns a value of record type Foo, you could write return (bar => 7, baz => comp_result); or return Foo'(bar => 7, baz => comp_result); (*) or return (7, comp_result); (**) or return Foo'(7, comp_result); In cases ** is just fine for me, in other cases I like * because it unambiguously tells me, the reader, what is returned. Aggregates must be qualified in SPARK, iirc. -- Georg