TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy

TEAM-ADA@LISTSERV.ACM.ORG

Options: Use Forum View

Use Monospaced Font
Show Text Part by Default
Condense Mail Headers

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

Print Reply
Sender:
"Team Ada: Ada Advocacy Issues (83 & 95)" <[log in to unmask]>
X-To:
Tucker Taft <[log in to unmask]>
Date:
Thu, 16 Jul 1998 10:40:48 -0400
Reply-To:
Steven Deller <[log in to unmask]>
Subject:
MIME-Version:
1.0
Content-Transfer-Encoding:
7bit
Content-Type:
text/plain; charset="us-ascii"
From:
Steven Deller <[log in to unmask]>
Parts/Attachments:
text/plain (30 lines)
Thanks Tucker for the clarification.  I too almost got into the mode of
thinking that if GNAT accepts it, it must be right.  I should know better
... sigh.

Apex also rejects (properly) the original code, since only if Left and
Right were Boolean would Standard.And apply.

Another approach that works is to use a child package to define the new
functions and refer back to the parent package definition of "and".

package Some_Package is
    type Private_Type is private;
private
    type Private_Type is array (0 .. 1023) of Boolean;
end Some_Package;

package Some_Package.Sub_Function is
    function "and" (Left, Right : Private_Type) return Private_Type;
end Some_Package.Sub_Function;

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

Regards,
Steve

ATOM RSS1 RSS2