comp.lang.ada
 help / color / mirror / Atom feed
From: EBEL@CLSEPF51.BITNET
Subject: BITNET mail follows
Date: Sat, 8-Nov-86 06:41:44 EST	[thread overview]
Date: Sat Nov  8 06:41:44 1986
Message-ID: <8611081141.AA27947@ucbvax.Berkeley.EDU> (raw)

In the following Ada program we get an error from our Compiler. It is indeed a
strange constuction, which must be complicated to compile, but it seems to us
a correct Ada Construct. Did we miss something ?              N.,Ebel

---- cut here ---------------------------------------------------------------
with TEXT_IO;
with INTEGER_TEXT_IO;

procedure TEST is

  type COMPLEX is
    record
      RE,IM: INTEGER;
    end record;

  V: COMPLEX := (1,2);
  W: COMPLEX := (1,2);

  function "*" (V1,V2:COMPLEX ) return INTEGER is

    JUNC :COMPLEX;
    subtype ST10_TYPE is STRING(1..10);

    function "+" (V1,V2:COMPLEX) return INTEGER renames "*";

    procedure WRITE_ST10(ST10: "*".ST10_TYPE) is
    --                          |
    --                          +------+
    --                                 |
    -- Here we have an error message --+
    --
    begin
      TEXT_IO.PUT(ST10);
      TEXT_IO.NEW_LINE;
    end WRITE_ST10;

  begin
    WRITE_ST10("1234567890");
    if V1 = V2 then
      JUNC.RE := V1.RE - 1;
      JUNC.IM := V1.IM - 1;
      return JUNC+V2;
    else
      return V1.RE*V2.RE*V1.IM*V2.IM;
    end if ;
  end "*";
begin
  INTEGER_TEXT_IO.PUT(V*W);
end TEST;

             reply	other threads:[~1986-11-08 11:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-11-08 11:41 EBEL [this message]
  -- strict thread matches above, loose matches on Subject: below --
1986-11-20 18:28 BITNET mail follows notes
1986-09-22 21:33 UKC340
1986-06-11 15:47 EBEL
replies disabled

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