comp.lang.ada
 help / color / mirror / Atom feed
From: johng@discovery.eng.auburn.edu (John M. Greer)
Subject: Ada as 2nd Lang, p. 678
Date: 1997/05/01
Date: 1997-05-01T00:00:00+00:00	[thread overview]
Message-ID: <5k92el$bs9@ultranews.duc.auburn.edu> (raw)


I was wondering if anyone could help for a second . . .
Ada as a Second Language (My favorite book) gives this listing
for an example using Generic subprograms, but GNAT complains of end-of-line;
it sees the declaration and stops.
"end of file expected, file can have only one compilation unit
gnatmake: "cyclic_successor_template.adb" compilation error"

GENERIC
   TYPE Discrete_Type IS (<>);
   FUNCTION Cyclic_Successor_Template (X : Discrete_Type) RETURN Discrete_Type;

--Generic subprogram body:

   FUNCTION Cyclic_Successor_Template (X:Discrete_Type) RETURN Discrete_Type IS
   BEGIN
      IF X = Discrete_Type'Last THEN
	 RETURN Discrete_Type;First;
      ELSE
	 RETURN Discrete_Type'Succ(X);
      END IF;
   END Cyclic_Successor_Template;





             reply	other threads:[~1997-05-01  0:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-01  0:00 John M. Greer [this message]
1997-04-30  0:00 ` Ada as 2nd Lang, p. 678 Matthew Heaney
1997-05-02  0:00 ` Robert Dewar
1997-05-09  0:00   ` nickerson
1997-05-12  0:00 ` Norman H. Cohen
  -- strict thread matches above, loose matches on Subject: below --
1997-05-12  0:00 Marin David Condic, 561.796.8997, M/S 731-93
1997-05-13  0:00 ` Robert Dewar
replies disabled

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