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=0.7 required=5.0 tests=BAYES_00,INVALID_DATE, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!utgpu!watmath!clyde!att!rutgers!mailrus!ukma!gatech!linus!mbunix!eachus From: eachus@mitre-bedford.ARPA (Robert Eachus) Newsgroups: comp.lang.ada Subject: Re: Collective response to := messages Summary: Basic operations are overloaded!! Keywords: User defined assignment Message-ID: <42334@linus.UUCP> Date: 30 Nov 88 18:24:27 GMT References: <8811282217.AA04896@ajpo.sei.cmu.edu> <24856@sri-unix.SRI.COM> Sender: news@linus.UUCP Reply-To: eachus@mbunix.mitre.org (Robert I. Eachus) Organization: The MITRE Corporation, Bedford, Mass. List-Id: There has been a lot of frothing at the mouth on both sides of this issue about what is or is not the Ada model of assignment. First of all a lot has been said about what a change to the language it would be to make assignment or other basic operations overloadable. However, if you look in 8.7 Context of Overload Resolution, the first paragraph states: "Overloading is defined for subprograms, enumeration literals, operators, and single entries, and also for the operations that are inherent in several basic operations such as assignment, membership tests, allocators, the literal null, aggregates, and string literals." Overloading, and overload resolution involving basic operations is a fact of Ada life. If you think otherwise try: package Overload_Test is type A is access Boolean; B: constant Boolean := null = null; type C is access Character; D: constant Boolean := null = null; end Overload_Test; The compiler should accept the decalartion of B, but reject the declaration of D. A lot of work went on during the language definition process to make similar (but useful) cases work for numeric types. If you object that this example involves equality which is not a basic operation instead try: package Overload_Two is A: Boolean := 'b' in 'a'..'c'; type New_Char is ('b', 'a', 'c'); C: Boolean := 'b' in 'a'..'c'; end Overload_Two;