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.5 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, STOX_REPLY_TYPE autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,54672440f4ffc24b X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!usenet-fr.net!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: "David C. Hoos, Sr." Newsgroups: comp.lang.ada Subject: Re: Invalid operator name? Date: Sat, 27 Nov 2004 15:47:11 -0600 Organization: Cuivre, Argent, Or Message-ID: References: NNTP-Posting-Host: lovelace.ada-france.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Trace: melchior.cuivre.fr.eu.org 1101592086 75598 212.85.156.195 (27 Nov 2004 21:48:06 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Sat, 27 Nov 2004 21:48:06 +0000 (UTC) Cc: comp.lang.ada@ada-france.org To: "Sandro Magi" Return-Path: X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: g2news1.google.com comp.lang.ada:6565 Date: 2004-11-27T15:47:11-06:00 As with many of the questions posed in this newsgroup, the answer is given explicitly in the Ada Reference Manual. Allow me to quote the relevant excerpt: 4.5 Operators and Expression Evaluation 1 The language defines the following six categories of operators (given in order of increasing precedence). The corresponding operator_symbols, and only those, can be used as designators in declarations of functions for user-defined operators. See 6.6, "Overloading of Operators". Syntax 2 logical_operator ::= and | or | xor 3 relational_operator ::= = | /= | < | <= | > | >= 4 binary_adding_operator ::= + | - | & 5 unary_adding_operator ::= + | - 6 multiplying_operator ::= * | / | mod | rem 7 highest_precedence_operator ::= ** | abs | not Please note the words "and only those" near the middle of the second line of 4.5(1) ----- Original Message ----- From: "Sandro Magi" Newsgroups: comp.lang.ada To: Sent: November 27, 2004 10:23 AM Subject: Invalid operator name? > When I try to define my own operator, I receive an "Invalid operator name" > error during compilation. I've found references to operator overloading in > reference materials, but no word whether new operators can be defined which > leads me to believe that it's not possible. > > Is it not possible to define new operators for a custom type? Can we only > override the base operators? > _______________________________________________ > comp.lang.ada mailing list > comp.lang.ada@ada-france.org > http://www.ada-france.org/mailman/listinfo/comp.lang.ada > >