comp.lang.ada
 help / color / mirror / Atom feed
From: agate!spool.mu.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!cs0.dasd.h
Subject: Re: Question of Visibility
Date: 2 Jul 93 14:53:55 GMT	[thread overview]
Message-ID: <1993Jul2.075355.1@perky.dasd.honeywell.com> (raw)

In article <1993Jul1.183945.21032@news.eng.convex.com>, pelakh@convex.com (Bori
s Pelakh) writes:
> 
> with text_io;
> package boolean_type_pkg is
>   type boolean is (FALSE, TRUE);
>   for boolean use (FALSE => 16#00#, TRUE => 16#ff#);
>   package boolean_io is new text_io.enumeration_io(boolean);
> end boolean_type_pkg;
> 
> with boolean_type_pkg; use boolean_type_pkg;
> procedure boolean_test is
>   flag : boolean := TRUE;
> begin
>   boolean_io.put(flag);
> end boolean_test;
> 
> My (Verdix-derived) front-end determines flag to be of type STANDARD.BOOLEAN.
> I say that is correct since according to 8.1.11, STANDARD is an all-enclosing
> declarative region, and thus has visibility precedence to the with'ed in pkg.
> My customer claims that is wrong. Any opinions ? Alternatively, is there any

You are right.  The VAX compiler does the same thing (and rightly so).  It
flags and inconsistency in the boolean_io.put(flag); statement since the
variable ->flag is not of the same type as is required by the instance
boolean_io.

My Tartan/960MC compiler gives me a stranger message though in saying that
the type boolean in the test procedure is not visible.  Evidently it is
confused about where the type boolean should come from (standard or
boolean_type_pkg).

> compiler out there that will accept the above code ? Mine rejects it since
> boolean_io.put requires BOOLEAN_TYPE_PKG.BOOLEAN.
> 
Just out of curiosity - why redefine the type boolean?  Is it just to use
the values in the representation clause?
> -- 
------------------------------------------------------------------------------
Todd A Sorensen               Honeywell Defense Avionics Systems Division
505-828-5611                  internet: tsorense@dasd.honeywell.com
                              internet: tas@dasd.honeywell.com
------------------------------------------------------------------------------ 

             reply	other threads:[~1993-07-02 14:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-07-02 14:53 agate!spool.mu.edu!sol.ctr.columbia.edu!The-Star.honeywell.com!cs0.dasd.h [this message]
  -- strict thread matches above, loose matches on Subject: below --
1993-07-08 14:21 Question of Visibility Gene Ouye
1993-07-08 12:17 Wes Groleau X7574
1993-07-07 21:15 Dave Bashford
1993-07-07 21:07 Bor is Pelakh
1993-07-07 20:15 Tucker Taft
1993-07-02 13:36 Boris Pelakh
1993-07-01 21:44 Gene Ouye
1993-07-01 18:39 Boris Pelakh
replies disabled

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