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: Ken Garlington Subject: Re: Leading zeros with Int_IO.Put()? Or another package? Date: 1996/11/13 Message-ID: <328A0DDD.94B@lmtas.lmco.com>#1/1 X-Deja-AN: 196317947 references: <327FB8A3.745B@itg-sepg.logicon.com> <55ubsh$lh0$1@goanna.cs.rmit.edu.au> <56bi13$3pa$1@goanna.cs.rmit.edu.au> content-type: text/plain; charset=us-ascii organization: Lockheed Martin Tactical Aircraft Systems mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.pl1 x-mailer: Mozilla 2.02 (Macintosh; I; 68K) Date: 1996-11-13T00:00:00+00:00 List-Id: 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." To read more, see: http://www.adahome.com/LRM/95/rm95html/rm9x-intro.html#goals or, for even more information about Ada: http://info.acm.org/sigada/ http://lglwww.epfl.ch/Ada/ http://sw-eng.falls-church.va.us/AdaIC/ > 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. With a well-designed abstraction, you can also have your compiler detect when you accidently did a put of one of those "etc."s when you meant to put an Apple_Type (or whatever). I assume PL/I has an equivalent capability? "Furthermore, error-prone notations have been avoided, and the syntax of the language avoids the use of encoded forms in favor of more English-like constructs." -- LMTAS - "Our Brand Means Quality" For more info, see http://www.lmtas.com or http://www.lmco.com