🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.lang.ada
Article #1042

Overloading "and"

#1042
From: Mike Linnig
Date: Fri, 31 Oct 1986 14:25
33 lines
1440 bytes
Here's something that I thought was illegal.  

We've all seen Ada programs that overloaded the standard operators
("+","-","*","/"). We've also seen people overload the concatination
operator "&".  But I didn't think it was possible to overload the
"AND" and "OR" operators.  

The following compiles without error on DEC Ada:

     PACKAGE test is

       function "and"(l,r: integer) return integer;

     END test;
     ----------------------------------------------------------------------
     WITH test; USE test;

     PROCEDURE mytest IS

     a, b,c : integer;

     BEGIN
       a := b AND c;		-- a call to the function TEST."AND" 
     END mytest;
     ----------------------------------------------------------------------

Many thanks to Renzo Bianchi and Gary Smith of TI, Colorado Springs for
bringing this to my attention.

Live and learn.

	-- Mike Linnig, 
	   Texas Instruments
Technical Details
Message-ID: <8611020431.AA01146@ucbvax.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!nike!ucbcad!ucbvax!ti-eg.CSNET!LINNIG

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!think!nike!ucbcad!ucbvax!ti-eg.CSNET!LINNIG
From: LINNIG@ti-eg.CSNET (Mike Linnig)
Newsgroups: net.lang.ada
Subject: Overloading "and"
Message-ID: <8611020431.AA01146@ucbvax.berkeley.edu>
Date: Fri, 31-Oct-86 09:25:00 EST
Article-I.D.: ucbvax.8611020431.AA01146
Posted: Fri Oct 31 09:25:00 1986
Date-Received: Mon, 3-Nov-86 22:44:35 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Organization: The ARPA Internet
Lines: 33