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,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!news.glorb.com!newsfeed.inode.at!solnet.ch!solnet.ch!news-zh.switch.ch!switch.ch!cernne03.cern.ch!cern.ch!news From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Enumeration literals and their associated functions Date: Thu, 20 Oct 2005 16:21:26 +0200 Organization: CERN - European Laboratory for Particle Physics Message-ID: NNTP-Posting-Host: abpc10883.cern.ch Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sunnews.cern.ch 1129818085 15152 (None) 137.138.37.241 X-Complaints-To: news@sunnews.cern.ch User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20050922 Red Hat/1.7.12-1.1.3.2.SL3 X-Accept-Language: en-us, en Xref: g2news1.google.com comp.lang.ada:5816 Date: 2005-10-20T16:21:26+02:00 List-Id: Hi, , paragraph 6 states that for each enumeration literal specification there is an appropriate parameterless function declated. type Color is (RED, GREEN, BLUE); type Function_Access is access function return Color; Fa : Function_Access := RED'Access; The compiler reports an error in the last line: "prefix of "Access" attribute cannot be enumeration literal" I understand that the use of "RED" in this line is not resolved to be a name of the function. If that is the case, then how can I use this function? Another example: Some_Function_That_Expects_Color(RED); Is the use of "RED" above considered to be a function call? If yes, then why in RED'Access it is resolved to be a literal? If instead "RED" above is considered to be a literal, then what's the sense of having an associated function at all? -- Maciej Sobczak : http://www.msobczak.com/ Programming : http://www.msobczak.com/prog/