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=2.1 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY,PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,f47e0c6e2e5fd00d X-Google-Attributes: gid103376,public From: Jeff Carter Subject: Re: Function name problem Date: 2000/01/15 Message-ID: <85qecu$24r$1@nnrp1.deja.com>#1/1 X-Deja-AN: 573026845 References: X-Http-Proxy: 1.0 x34.deja.com:80 (Squid/1.1.22) for client 152.163.206.182 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Sat Jan 15 18:30:53 2000 GMT X-MyDeja-Info: XMYDJUIDjrcarter001 Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; AOL 5.0; Windows 95; DigExt; Freei Client 2.1) Date: 2000-01-15T00:00:00+00:00 List-Id: In article , Harald Schmidt wrote: > Hi, > > I want to declare two function, but the 2nd is not > allowed by GNAT3.12. Could someone tell me why? > Here are the two declarations: > > package bla is > type Object is tagged limited private; > function "=" (Left, Right: in Object�Class) return Boolean; > function "==" (Left, Right: in Object�Class) return Boolean; > private > type Object is tagged limited null record; > end bla; A function declaration with the function designator (name) in quotation marks (such as "=") defines an operator. The set of operator symbols is fixed in Ada. While you can define operators for your types, as you did with "=", you cannot create new operator symbols, as you tried to do with "==". See ARM 4.5, 6.1, and 6.6. -- Jeff Carter "Now go away or I shall taunt you a second time." -- Monty Python and the Holy Grail Sent via Deja.com http://www.deja.com/ Before you buy.