From: hnptz@yahoo.de
Subject: Ada.Containers.Vectors
Date: Mon, 26 Jun 2017 09:39:20 -0700 (PDT)
Date: 2017-06-26T09:39:20-07:00 [thread overview]
Message-ID: <3516c666-ef65-4e54-89e9-03f14f293493@googlegroups.com> (raw)
Here is my code:
with Ada.Containers; use Ada.Containers;
with Ada.Containers.Vectors;
package RGF is
package IV is new Vectors(Natural,Integer);
use IV;
procedure GenerateRGF(m : Integer;
f : in out Vector);
end RGF;
package body RGF is
use IV;
procedure GenerateRGF(m : Integer;
f : in out Vector) is
done : Boolean := False;
fmax : Vector;
j : Integer;
begin
for i in 1..m loop
f(i):=1;
fmax(i) := 2;
end loop;
while not done loop
j := m+1;
loop
j := j-1;
exit when f(j) /= fmax(j);
end loop;
if j > 1 then
f(j) := f(j)+1;
for i in j+1 .. m loop
f(i):=1;
if f(j) = fmax(j) then
fmax(i):=fmax(j)+1;
else
fmax(i):=fmax(j);
end if;
end loop;
else
done := True;
end if;
end loop;
end GenerateRGF;
end RGF;
As a result I get "ambiguous operands for equality" for /= and =. How to resolve these ambiguities?
Best,
Gilbert
next reply other threads:[~2017-06-26 16:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-26 16:39 hnptz [this message]
2017-06-26 18:06 ` Ada.Containers.Vectors Per Sandberg
2017-06-27 6:15 ` Ada.Containers.Vectors G.B.
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox