comp.lang.ada
 help / color / mirror / Atom feed
From: dyer@ajpo.sei.cmu.edu (Richard Dye)
Subject: Visibility in Embedded Packages
Date: 28 Oct 90 15:51:01 GMT	[thread overview]
Message-ID: <718@ajpo.sei.cmu.edu> (raw)



In the previous edition of Ada Letters, Bird wrote to Dear Ada that he liked
to embed an operators package in his types packages so he could provide 
direct visibility to the infix operators without providing direct 
visibility to the types themselves (via a use clause).  We've tried this
on three different compilers and each compiler requires a different syntax
to achieve the effect.  My question to all the language lawyers is why?
Which one is right?  (The three compilers are Telesoft 1.3 and 1.4 self-
hosted on Sun 3s and VAX ACS (Don't know the version.))

The code we tried is:

package Standard_Types is
Min_Integer : constant := -1 * (2 ** 31);
Max_Integer : constant := (2 ** 31) -1;
type Integer_Type is range Min_Integer .. Max_Integer;

package Operators is
function "+"(L,R : Integer_Type) return Integer_Type renames "+";
end Operators;

end Standard_Types;

The above works fine on the Telesoft 1.4.

The Telesoft 1.3 requires:
function "+"(L,R : Integer_Type) return Integer_Type renames Standard."+";

The VAX requires:
function "+"(L,R : Integer_Type) return Integer_Type renames Standard_Types."+";


I'm working from memory so I may not have the correct associations between
compilers and requirements but the three fixes were what we had to do.
Dick

Dick Dye
CTA, Inc.
M/S N8910
National Test Bed
Falcon AFB, CO 80912-5000
(719) 380-2578
FAX: (719) 380-3100 (Put M/S N8910 on the first page)
dyer@ajpo.sei.cmu.edu

             reply	other threads:[~1990-10-28 15:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1990-10-28 15:51 Richard Dye [this message]
1990-10-29 15:29 ` Visibility in Embedded Packages stt
1990-10-31 20:21 ` Jean Pierre Rosen
  -- strict thread matches above, loose matches on Subject: below --
1990-10-30 14:44 "Norman H. Cohen"
replies disabled

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