From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1edeadc9be5a2350,start X-Google-Attributes: gid103376,public From: johng@discovery.eng.auburn.edu (John M. Greer) Subject: Ada as 2nd Lang, p. 678 Date: 1997/05/01 Message-ID: <5k92el$bs9@ultranews.duc.auburn.edu>#1/1 X-Deja-AN: 238566334 Organization: Auburn University Engineering Newsgroups: comp.lang.ada Date: 1997-05-01T00:00:00+00:00 List-Id: 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;