TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Classic View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

Topic: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-To: Juergen Hoyng <[log in to unmask]>
Date: Thu, 16 Jul 1998 10:24:55 +0200
Reply-To: "Alexander.Heim" <[log in to unmask]>
From: "Alexander.Heim" <[log in to unmask]>
Content-Transfer-Encoding: 7bit
Sender: "Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
Parts/Attachments: text/plain (59 lines)
Hi Teamers,


I'm posting the following problem for a friend of mine:


> I have the following problem, when trying to implement a function "and".
>
>  package Some_Package is
>    type Private_Type is private;
>    function "And" (Left, Right: Private_Type) return Private_Type ;
>  private
>    type Private_Type is array (0 .. 1023) of Boolean;
>  end Some_Package;
>
>
> -- I want to implement Some_Package."And" using the predefined logical
> -- operation "And" for any one-dimensional array type whose components
> -- are of a boolean type.
>  package body Some_Package is
>    function "And" (Left, Right: Private_Type) return Private_Type   is
>    begin
>      return Left and Right;  -- ERROR: AND is here Some_Package."AND",
>                              -- endless recursive
>    end "and";
>  end Some_Package;
>
> To fix the error in the implementation above, I need to qualify the
> predefined
> "And" operation:
>
>
>  package body Some_Package is
>    function "And" (Left, Right: Private_Type) return Private_Type is
>    begin
>      return Standard."And" (Left, Right);  -- ERROR: not possible
>    end "and";
>  end Some_Package;
>
> How is it possible to qualify the predefined logical operations to
> distinguish between Some_Package."and" and the predefined "and"?
>
> Thanks in advance,
>
>
> Juergen Hoyng,  RIO 62             |   email : [log in to unmask]
> DASA/RI                            |   fax   : +49 421 539 4529
> Postfach 286156                    |   voice : +49 421 539 5348
> D-28361 Bremen                     |
> Germany




--
Alexander Heim                       ___       Phone:  +49 421 539-5869
Daimler-Benz Aerospace AG     ________|________  Fax:  +49 421 539-4424
mailto:[log in to unmask]      0

ATOM RSS1 RSS2