comp.lang.ada
 help / color / mirror / Atom feed
* redefinition of the operator
@ 2005-11-20  8:49 Francesco Bochicchio
  2005-11-20 10:50 ` Dmitry A. Kazakov
  2005-11-20 11:12 ` Martin Krischik
  0 siblings, 2 replies; 10+ messages in thread
From: Francesco Bochicchio @ 2005-11-20  8:49 UTC (permalink / raw)



Hi all,

I need to redefine the standard mathematic operators, to replace them with
my own version. 

So, if I do something like this, it works:

-- ******************************
procedure Test_MyOperators is
   A,B : Long_Float;
   function "+"(X, Y : Long_Float) return Long_Float
   is
   begin
      return X;
   end;

begin
   A := 1.0;
   B := 2.0;

   if A = A+B then
      Put_Line("Yes.");
   else
      Put_Line("No");
   end if;
end;
-- -------------------------------------

But since I have many packages, I want to put the redefined operators 
in a separate package, say MY_OPERATORS, and doing instead:

-- *************************************

with MY_OPERATORS; use MY_OPERATORS;

procedure Test_MyOperators is
   A,B : Long_Float;

begin
   A := 1.0;
   B := 2.0;

   if A = A+B then
      Put_Line("Yes.");
   else
      Put_Line("No");
   end if;
end;
-- -----------------------------------------------

But this does not work.The function Test_MyOperators
keep using the standard "+" instead of the redefined one 
exported by MY_OPERATORS.

Anybody knows how to do this?

Thanks in advance.

Ciao
-------
FB




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-11-21 14:40 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-20  8:49 redefinition of the operator Francesco Bochicchio
2005-11-20 10:50 ` Dmitry A. Kazakov
2005-11-20 12:16   ` Francesco Bochicchio
2005-11-20 13:27     ` Dmitry A. Kazakov
2005-11-20 21:29     ` Gautier Write-only
2005-11-21 14:23     ` Jean-Pierre Rosen
2005-11-20 11:12 ` Martin Krischik
2005-11-20 12:23   ` Francesco Bochicchio
2005-11-21 14:26   ` Jean-Pierre Rosen
2005-11-21 14:40   ` Robert A Duff

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