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=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3bf50ede73cff892,start X-Google-Attributes: gid103376,public From: Richard Irvine Subject: Operators Questions Date: 1996/10/29 Message-ID: <3275D478.5952@eurocontrol.fr>#1/1 X-Deja-AN: 192874431 content-type: text/plain; charset=us-ascii organization: Eurocontrol Experimental Centre, Bretigny-Sur-Orge, France mime-version: 1.0 newsgroups: comp.lang.ada x-mailer: Mozilla 2.0 (X11; I; HP-UX A.09.05 9000/755) Date: 1996-10-29T00:00:00+00:00 List-Id: Ada allows overloading of the predefined operators but not definition of new operators. Sometimes code could be made more readable if it were possible to define new operators, e.g. if aTimeInterval encloses anotherTimeInterval then -- It is clear which interval encloses which. ... instead of if encloses(aTimeInterval, anotherTimeInterval) then -- Which interval enclosed which? -- One has to look at the declaration of -- the function. -- One could use formal parameters, but -- then things start to get long-winded. ... I guess that allowing the programmer to define his own operators creates difficulties for the compiler writer, or is there some other reason why definition of new operators is not allowed in Ada? Are there languages which do allow defintion of new operators?