< Ada Programming
Standard operators
Ada allows operator overloading for all standard operators and so the following summaries can only describe the suggested standard operations for each operator. It is quite possible to misuse any standard operator to perform something unusual.
Each operator is either a keyword or a delimiter—hence all operator pages are redirects to the appropriate keyword or delimiter.
Operators have arguments which in the RM are called Left and Right for binary operators, Right for unary operators (indicating the position with respect to the operator symbol).
The list is sorted from lowest precedence to highest precedence.
Logical operators
Relational operators
Binary adding operators
Unary adding operators
Multiplying operator
Highest precedence operator
Short-circuit control forms
These are not operators and thus cannot be overloaded.
Membership tests
The Membership Tests also cannot be overloaded because they are not operators.
- in
- element of, , e.g.
, (also keywordif
Iin
Positivethen
in
) - not in
- not element of, , e.g.
, (also keywordsif
Inot
in
Positivethen
not
in
)
Range membership test
if
Todaynot
in
Tuesday .. Thursdaythen
...
Subtype membership test
Is_Non_Negative := X in
Natural;
Class membership test
exit
when
Objectin
Circle'Class;
See also
Wikibook
Ada 95 Reference Manual
Ada 2005 Reference Manual
Ada Quality and Style Guide
Ada Operators | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
This article is issued from Wikibooks. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.