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/12/02 Message-ID: <32A2BDF3.53A0@lmtas.lmco.com>#1/1 X-Deja-AN: 201908397 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> <56rgou$r4k$1@goanna.cs.rmit.edu.au> <3295F2A9.1EF0@lmtas.lmco.com> 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-12-02T00:00:00+00:00 List-Id: Verne Arase wrote: > > In article <3295F2A9.1EF0@lmtas.lmco.com>, > Ken Garlington wrote: > > > use Ada.Text_IO.Editing; > > ... > > package Edited_IO is new Decimal_Output (type); > > ... > > Edited_IO.Put (n, To_Picture ("-99999999")); > > > >Interesting. They look reasonably similar to me. If anything, > >the Ada version makes it clear from the text that this > >I/O is using the Picture feature of the language. However, > >if you believe "P" is more readable in this regard, I > >suppose we'll have to agree to disagree... > > Well, we are talking about a langugage primative rather than a subroutine > library. I'm not sure what a "language primitive" is, but any Ada compiler that implements the Information Systems annex of the Ada standard (ISO/IEC 8652:1995) will support the three lines written above (which can also be re-written as two slightly longer lines, if desired). Specifically, the generic package Ada.Text_IO.Editing.Decimal_Output is supplied by the compiler, just as the body of SQRT would be provided (via a subroutine library, in many cases) by most FORTRAN compilers. The only definitions supplied by the user in this case, other than the lines shown above, are "n" and "type", which refer to the value to be formatted and its type, respectively. Assuming that a generic package supplied by the compiler does not meet your definition of a "language primitive," what's the relevance of this to the lines you quoted? Is there a language design philosophy for PL/I that says "language primitives" should be very terse? Is this in the standard somewhere? > Or are you saying that PayRoll is also built into the language (and > implemented in a single statement)? Since I don't know to what "PayRoll" you are referring, I certainly would not claim it is part of the Ada language (or any other language :). I would say something is "built into" the language if it is defined by the language specification. For Ada.Text_IO.Editing.Decimal_Output, this is the case. See http://www.adahome.com/rm95/rm9x-F-03.html "Edited Output for Decimal Types," in the on-line version of the Ada standard. (By the way, is there an equivalent on-line version of the ISO PL/I standard?) -- LMTAS - "Our Brand Means Quality" For more info, see http://www.lmtas.com or http://www.lmco.com