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=2.3 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_REPLYTO,INVALID_MSGID,REPLYTO_WITHOUT_TO_CC 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: Dmitriy Anisimkov Subject: Re: Generics and I/O Date: 1998/10/03 Message-ID: <36159D3E.EEADFF66@chat.ru>#1/1 X-Deja-AN: 397246551 Content-Transfer-Encoding: 7bit References: Content-Type: text/plain; charset=us-ascii MIME-Version: 1.0 Reply-To: anisimkov@yahoo.com Newsgroups: comp.lang.ada Date: 1998-10-03T00:00:00+00:00 List-Id: if you Item is a scalar type then : with Text_IO; > generic > type Item is private; > package Foo is > -- ... -- procedure Print(Value : Item) is > -- ... -- Text_IO.Put( Value'Image ); > -- ... -- > end Print; > end Foo; if you Item is only integer type then : with Ada.Text_IO.Integer_IO; > generic type Item is range <>; -- must be > package Foo is > -- ... -- package Item_IO is new Ada.Text_IO.Integer_IO(Item); -- instantiation use Item_IO; procedure Print(Value : Item) is -- must be > -- ... -- Put( Value ); -- must be > -- ... -- > end Print; > end Foo;