From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 25 Sep 92 02:19:25 GMT From: portal!cup.portal.com!R_Tim_Coslet@uunet.uu.net Subject: Re: Difference between a function and an operation Message-ID: <66561@cup.portal.com> List-Id: In article: <1992Sep24.152726.17404@linus.mitre.org> jclander@texas.mitre.org (Julian C. Lander) wrote... >You've got it right. Operations in Ada are functions, which is why >the overloading works. You can't overload the function "/=", because >that is defined to be the opposite of "=", which can be overloaded. > >The operational notation is merely a notational convenience. I >don't remember offhand when you can use it for your own defined >functions, and I'm too lazy to check the LRM. The only functions that can use the "operational notation" are functions of 1 or 2 parameters whose names are the predefined operators having the same number of parameters (e.g. "+"(x,y), "-"(x,y), "-"(x), "*"(x,y), "/"(x,y), ">"(x,y), "<"(x,y), etc....). It is not permitted in Ada to name functions with "operator symbols" that are not already defined in the language (e.g. "!"(x) could not be used to define a factorial operator function of x). It is possible to use the Renames declaration to rename a function originally defined with a name so that it may now be refered to using an operator notation (if it already has the matching number of parameters). e.g. function "+"(x,y) renames fancy_sum(x,y); (don't take the above example as correct Ada syntax, refer to the LRM for the right syntax for this statement. I left my LRM at work.) R. Tim Coslet Usenet: R_Tim_Coslet@cup.portal.com technology, n. domesticated natural phenomena