comp.lang.ada
 help / color / mirror / Atom feed
From: Jeff Carter <jrcarter001@my-deja.com>
Subject: Re: Function name problem
Date: 2000/01/15
Date: 2000-01-15T00:00:00+00:00	[thread overview]
Message-ID: <85qecu$24r$1@nnrp1.deja.com> (raw)
In-Reply-To: B4A633AE.3FF3%Harald.Schmidt@tomcat.de

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1004 bytes --]

In article <B4A633AE.3FF3%Harald.Schmidt@tomcat.de>,
  Harald Schmidt <Harald.Schmidt@tomcat.de> 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.




  parent reply	other threads:[~2000-01-15  0:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-01-15  0:00 Function name problem Harald Schmidt
2000-01-15  0:00 ` Matthew Heaney
2000-01-15  0:00 ` Pascal Obry
2000-01-15  0:00 ` Jeff Carter [this message]
2000-01-16  0:00   ` Harald Schmidt
2000-01-16  0:00     ` David Starner
2000-01-16  0:00       ` David C. Hoos, Sr.
2000-01-16  0:00         ` David Starner
2000-01-18  0:00         ` Howard W. LUDWIG
2000-01-16  0:00       ` David A. Cobb
2000-01-16  0:00         ` David Starner
2000-01-17  0:00           ` David A. Cobb
2000-01-17  0:00             ` David Starner
2000-01-17  0:00               ` Jeff Carter
2000-01-16  0:00     ` Matthew Heaney
2000-01-16  0:00       ` Harald Schmidt
2000-01-16  0:00         ` Gautier
2000-01-17  0:00         ` Matthew Heaney
2000-01-26  0:00       ` Florian Weimer
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox