comp.lang.ada
 help / color / mirror / Atom feed
* converted types as actual in out parameters
@ 1988-09-17 11:18 "Jonathan B. Owen"
  1988-09-20 16:05 ` Scott Moody
  1988-09-23 15:41 ` Burch Seymour
  0 siblings, 2 replies; 4+ messages in thread
From: "Jonathan B. Owen" @ 1988-09-17 11:18 UTC (permalink / raw)


The following worked for Vax-Ada but not for Verdix Ada.  Any thoughts?
Is it a quirk of Vax-Ada to allow the following or a bug of Verdix
which causes the return of erronious values?

   procedure TEST is

       a : short_integer;

       procedure set_value( value : in out integer ) is
       begin
          value := 1;
       end set_value;

   begin
       set_value( integer(a) );

       if a = 1
       then
           put_line("This is a Vax-Ada compiler!");
       else
           put_line("Is this a Verdix Ada compiler?");
       end if;
   end TEST;

The Version of the Verdix Ada I tried was very old (ver. 2?).   Maybe in newer
version this is corrected.  I noticed in this version that the "pack" pragma
does not work!  Each field of the packed record starts on a new boundry.

Also,  **** BUG IN VAX-ADA COMPILER ***, try converting a value of type
real to short_integer.  You will get during compilation "Compiler Internal
Error"!.  I solved the problem by an intermediate conversion to integer
and only then to short_integer.

                  I would appreciate any comments on the above.

                                                            JB
______________________________________________________________________________
  (--)    /--)     /-(\                 Email: gdau100@bguvm (bitnet)
  \ /    /--K      | \|/\   /\/) /|-\   Snail: 55 Hovevei Zion
  _/_/o /L__)_/o \/\__/  \X/  \_/ | |_/        Tel-Aviv, 63346  ISRAEL
 (/        Jonathan B. Owen             Voice: (03) 281-422

 Point of view:  A chicken is the means by which an egg reproduces an egg.
______________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread
* Re: converted types as actual in out parameters
@ 1988-09-16 23:48 sboyd
  0 siblings, 0 replies; 4+ messages in thread
From: sboyd @ 1988-09-16 23:48 UTC (permalink / raw)



 
Regarding your procedure --

procedure TEST is

       a : short_integer;

       procedure set_value( value : in out integer ) is
       begin
          value := 1;
       end set_value;

   begin
       set_value( integer(a) );

       if a = 1
       then
           put_line("This is a Vax-Ada compiler!");
       else
           put_line("Is this a Verdix Ada compiler?");
       end if;
   end TEST;

-- 
Meridian's v2.2 AdaVantage also considers "a = 1" as a true predicate.

Stowe Boyd                               Meridian Software Systems
Director of Research and Development     23141 Verdugo Drive #105
sboyd%Meridian.COM@ICS.UCI.EDU           Laguna Hills CA 92653
                                         714/380-9800

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1988-09-23 15:41 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-09-17 11:18 converted types as actual in out parameters "Jonathan B. Owen"
1988-09-20 16:05 ` Scott Moody
1988-09-23 15:41 ` Burch Seymour
  -- strict thread matches above, loose matches on Subject: below --
1988-09-16 23:48 sboyd

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