From: "David C. Hoos, Sr." <david.c.hoos.sr@ada95.com>
To: "Sandro Magi" <smagi@naasking.homeip.net>
Cc: comp.lang.ada@ada-france.org
Subject: Re: Invalid operator name?
Date: Sat, 27 Nov 2004 15:47:11 -0600
Date: 2004-11-27T15:47:11-06:00 [thread overview]
Message-ID: <mailman.134.1101592086.10401.comp.lang.ada@ada-france.org> (raw)
In-Reply-To: IR1qd.68030$Ro.2624307@news20.bellglobal.com
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" <smagi@naasking.homeip.net>
Newsgroups: comp.lang.ada
To: <comp.lang.ada@ada-france.org>
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
>
>
prev parent reply other threads:[~2004-11-27 21:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-27 16:23 Invalid operator name? Sandro Magi
2004-11-27 16:50 ` Stephen Leake
2004-11-27 19:21 ` Martin Krischik
2004-11-27 21:47 ` David C. Hoos, Sr. [this message]
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox