From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.lang.ada Subject: Re: Integer_IO or Modular_IO with different base as default Date: Mon, 15 Nov 2021 22:13:28 +0000 Organization: A noiseless patient Spider Message-ID: <87tugdnk3b.fsf@bsb.me.uk> References: <49db08e4-4380-4877-9e50-a986856c9821n@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="5fe867269cb9ac96facdd1dae680befb"; logging-data="30792"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18WpDrKDhvymdlvLggGcH1UnmL8h8dndoU=" Cancel-Lock: sha1:XRrfcdVhviLdJUBq2mPZB1xqkhY= sha1:j+47bw9lfE2zpXjOm+I6ExI+h3o= X-BSB-Auth: 1.bfdbf931ebe71224d9ed.20211115221328GMT.87tugdnk3b.fsf@bsb.me.uk Xref: reader02.eternal-september.org comp.lang.ada:63122 List-Id: Ken Roberts writes: > Does anyone have an idea on how to instantiate Integer_IO (or > Modular_IO) with Default_Base := 8 ? Instantiate Integer_IO and then assign Default_Base := 8: with Ada.Text_IO; use Ada.Text_IO; procedure Oct is package Oct_IO is new Integer_IO(Integer); begin Oct_IO.Default_Base := 8; Oct_IO.Put(16); end Oct; (Add "use Oct_IO;" if you prefer.) I don't think there is a way to do this on instantiation so that Default_Base is 8 and can't be changed, which would be nice. (Note: my Ada is /very/ rusty. Take /anyone's/ answer over mine about this!) -- Ben.