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,b6751ae58ef95a4f X-Google-Attributes: gid103376,public From: dale@cs.rmit.edu.au (Dale Stanbrough) Subject: Re: Generics and I/O Date: 1998/10/07 Message-ID: #1/1 X-Deja-AN: 398495347 References: X-Complaints-To: abuse@cs.rmit.edu.au X-Trace: emu.cs.rmit.edu.au 907729443 22657 131.170.27.23 (7 Oct 1998 03:04:03 GMT) Organization: RMIT NNTP-Posting-Date: 7 Oct 1998 03:04:03 GMT Newsgroups: comp.lang.ada Date: 1998-10-07T03:04:03+00:00 List-Id: Robert I. Eachus wrote: "Now if there is a visible Put procedure which matches the profile, you are all set. Otherwise you will have to pass it during the instantiation explicity: with Ada.Integer_Text_IO; package Int_Foo is new Foo(Integer,Ada.Integer_Text_IO.Put);" But that won't work, because ada.integer_text_Io.put has a 2nd parameter, the width field. If you want to do this (which i did recently), you have to write a wrapper procedure which creates a bridge between the simple profile that the generic expects, and any parameters that the "real" procedure has. E.g. Generic expects procedure... procedure Put (Item : Element); Ada.Integer_Text_IO.Put has... procedure Put (Item : Integer; Width : Natural); So you need a procedure... procedure Put (Item : Integer) is begin Ada.Integer_Text_IO.Put (Item, Ada.Integer_Text_IO.Default_Width); end; Dale