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,cea502f7b2820a37 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.volia.net!news.germany.com!feeder2.news.jippii.net!reader1.news.jippii.net!53ab2750!not-for-mail From: Niklas Holsti Organization: Tidorum Ltd User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050513 Debian/1.7.8-1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Enumeration literals and their associated functions References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Thu, 20 Oct 2005 20:03:04 +0300 NNTP-Posting-Host: 81.17.205.61 X-Complaints-To: newsmaster@saunalahti.com X-Trace: reader1.news.jippii.net 1129827875 81.17.205.61 (Thu, 20 Oct 2005 20:04:35 EEST) NNTP-Posting-Date: Thu, 20 Oct 2005 20:04:35 EEST Xref: g2news1.google.com comp.lang.ada:5825 Date: 2005-10-20T20:03:04+03:00 List-Id: Maciej Sobczak wrote: > Hi, > > , paragraph 6 > states that for each enumeration literal specification there is an > appropriate parameterless function declated. > > type Color is (RED, GREEN, BLUE); > > ... > If instead "RED" above is considered to be a literal, then what's the > sense of having an associated function at all? I believe that the LRM defines enumeration literals as functions because this automatically defines their overloading. That is, you can have another enumeration type that also has the literal RED (a synonym), yet overloading lets the compiler resolve which RED is meant, by the context. -- Niklas Holsti Tidorum Ltd niklas holsti tidorum fi . @ .