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: 101deb,495b037244521cf3 X-Google-Attributes: gid101deb,public X-Google-Thread: 103376,22b2c05a8088bbb2 X-Google-Attributes: gid103376,public From: rav@goanna.cs.rmit.edu.au (robin) Subject: Re: Leading zeros with Int_IO.Put()? Or another package? Date: 1996/11/19 Message-ID: <56rgou$r4k$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 197379601 expires: 20 February 1997 00:00:00 GMT references: <327FB8A3.745B@itg-sepg.logicon.com> <55ubsh$lh0$1@goanna.cs.rmit.edu.au> <56bi13$3pa$1@goanna.cs.rmit.edu.au> <328A0DDD.94B@lmtas.lmco.com> organization: Comp Sci, RMIT, Melbourne, Australia newsgroups: comp.lang.ada,comp.lang.pl1 nntp-posting-user: rav Date: 1996-11-19T00:00:00+00:00 List-Id: Ken Garlington writes: >robin wrote: >> >> PL/I picture editing is a lot simpler than using Ada's, >> which -- if implemented by the compiler -- applies to decimal types. >Absolutely true. Ada implements strong type checking, which can make >writing Ada more complex. The advtantages of strong type checking tend >to outweigh this, however, particularly for large and/or critical systems. >From the Introduction section of ISO/IEC 8652:1995: >"The need for languages that promote reliability and simplify maintenance >is well established. Hence emphasis was placed on program readability over >ease of writing." Ada clearly failed in this aspect. >> For *any* data type -- binary integer, decimal integer, >> float, complex, etc, PL/I has full picture editing. >> >> It's ony necessary to use a simple line such as: >> >> put edit (n) (P'-99999999'); >> >> or, for the real mccoy, >> >> put edit (d) (P'999.V999'); [d is decimal fixed with fraction, >> or floating-point, PICTURE, etc] >> >> which is a lot less than the (up to) 82 lines of Ada code >> suggested by various posters to force zeros to print. >Of course, once you have the zero-fill package (or whatever >other abstraction you intend to reuse), the number of lines >you have to write drops quite a bit. No excuse for having everyone who wants to use such a facility to have to write it. It is, after all, avalable ina number of languages including COBOL and PL/I. The simplicity and usefulness of PL/I in producing zero suppression/insertion of characters/general editing/ in a variety of forms (integer, fixed-point, floating-point) and suitable for business and science cannot be refuted. As I indicated earlier, just one short line will suffice! : put edit (d) (P'999.V999');