comp.lang.ada
 help / color / mirror / Atom feed
From: LINNIG@ti-eg.CSNET (Mike Linnig)
Subject: Overloading "and"
Date: Fri, 31-Oct-86 09:25:00 EST	[thread overview]
Date: Fri Oct 31 09:25:00 1986
Message-ID: <8611020431.AA01146@ucbvax.berkeley.edu> (raw)

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

             reply	other threads:[~1986-10-31 14:25 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-10-31 14:25 Mike Linnig [this message]
     [not found] <1146@ucbvax.berkeley.edu>
1986-11-06 15:47 ` Overloading "and" stt
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox