comp.lang.ada
 help / color / mirror / Atom feed
* Ada.Containers.Vectors
@ 2017-06-26 16:39 hnptz
  2017-06-26 18:06 ` Ada.Containers.Vectors Per Sandberg
  2017-06-27  6:15 ` Ada.Containers.Vectors G.B.
  0 siblings, 2 replies; 3+ messages in thread
From: hnptz @ 2017-06-26 16:39 UTC (permalink / 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



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

end of thread, other threads:[~2017-06-27  6:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-26 16:39 Ada.Containers.Vectors hnptz
2017-06-26 18:06 ` Ada.Containers.Vectors Per Sandberg
2017-06-27  6:15 ` Ada.Containers.Vectors G.B.

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