comp.lang.ada
 help / color / mirror / Atom feed
From: "Nasser M. Abbasi" <nma@12000.org>
Subject: basic question on Ada programming
Date: Wed, 23 Jan 2019 21:59:24 -0600
Date: 2019-01-23T21:59:24-06:00	[thread overview]
Message-ID: <q2bd6o$m0v$1@gioia.aioe.org> (raw)

I forgot these since I did not program in Ada for long time.

Very basic question. In this

---------------------------
with Ada.Text_Io;
with Ada.Numerics.Real_Arrays;

procedure main is
   A : constant Ada.Numerics.Real_Arrays.Real_Matrix :=
            (( 1.0,  2.0,  3.0),
            ( 4.0,  5.0,  6.0),
            ( 7.0,  8.0,  9.0));

   v : constant Ada.Numerics.Real_Arrays.Real_Vector := (1.0,2.0,3.0);
   procedure put (x : Ada.Numerics.Real_Arrays.Real_Vector) is
     begin
          FOR e of x LOOP
              Ada.Text_Io.put_line(float'image(e));
          END LOOP;
    end put;
    --use Ada.Numerics.Real_Arrays;
begin
     put(A*v); -- error here, since it does not see *
end main;
------------------

How can I write put(A*v) above, without having to do

      use Ada.Numerics.Real_Arrays;

above it?

I am trying to see if I can avoid doing use Ada.Numerics.Real_Arrays
so that I can explicitly add Ada.Numerics.Real_Arrays.something every
where, so I know where the something is coming from when looking at
the code.

But what about the *?  How to tell Ada it is coming from
Ada.Numerics.Real_Arrays without doing an explicit use? What
would the syntax be?

Using gnat community 2018.

Thanks
--Nasser


             reply	other threads:[~2019-01-24  3:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-24  3:59 Nasser M. Abbasi [this message]
2019-01-24  7:58 ` basic question on Ada programming Niklas Holsti
replies disabled

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