comp.lang.ada
 help / color / mirror / Atom feed
From: dennison@telepath.com
Subject: Re: How can I qualify the predefined logical operations
Date: 1998/07/16
Date: 1998-07-16T00:00:00+00:00	[thread overview]
Message-ID: <6olhkt$9qa$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 6okcnl$n93$1@nnrp1.dejanews.com

Whoops. OK I see what you are getting at.

In article <6okcnl$n93$1@nnrp1.dejanews.com>,
  hoyngj@my-dejanews.com wrote:
> I have the following problem, when trying to implement a function "and".
...
>    type Private_Type is array (0 .. 1023) of Boolean;
...
>    function "And" (Left, Right: Private_Type) return Private_Type is
>    begin
>      return Standard."And" (Left, Right);  -- ERROR: not possible
>    end "and";

The best way I can see to get around this problem is the following:


 package Some_Package is
   type Private_Type is private;
   function "And" (Left, Right: Private_Type) return Private_Type ;
 private
   type And_Type is array (0 .. 1023) of Boolean;
   type Private_Type is new And_Type;
 end Some_Package;

 package body Some_Package is
   function "And" (Left, Right: Private_Type) return Private_Type   is   begin
     return Private_Type(And_Type(Left) and And_Type(Right));
   end "and";
end Some_Package;

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum




  parent reply	other threads:[~1998-07-16  0:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-07-16  0:00 How can I qualify the predefined logical operations hoyngj
1998-07-16  0:00 ` hoyngj
1998-07-17  0:00   ` Robert Dewar
1998-07-16  0:00 ` dennison [this message]
1998-07-16  0:00 ` Tucker Taft
1998-07-16  0:00 ` dennison
1998-07-16  0:00 ` Anonymous
1998-07-17  0:00 ` Andreas Kalla
1998-07-19  0:00   ` Mats Weber
1998-07-25  0:00 ` Matthew Heaney
replies disabled

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