comp.lang.ada
 help / color / mirror / Atom feed
From: Ken Garlington <garlingtonke@lmtas.lmco.com>
Subject: Re: Leading zeros with Int_IO.Put()? Or another package?
Date: 1996/11/22
Date: 1996-11-22T00:00:00+00:00	[thread overview]
Message-ID: <3295F2A9.1EF0@lmtas.lmco.com> (raw)
In-Reply-To: 56rgou$r4k$1@goanna.cs.rmit.edu.au


robin wrote:
> Ken Garlington <garlingtonke@lmtas.lmco.com> writes:
> 
>         >"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.

Hmmm. So you consider the syntax

  put edit (n) (P'-99999999');

more readable than the Ada equivalent

  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...

>         >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.

1. Why does everyone have to rewrite publicly-available code? I usually
just reuse it. (Perhaps this is an Ada-unique mindset.)

2. The equivalent of your code is directly available in Ada, if
desired (see above).

> 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');

What I don't understand is, given the statement above, how I can
restrict the use of the statement above so that "d" is always a
numeric value in the range 0.000 .. 999.999. Implicit strong
typing is available in a number of languages, including Ada, so
there's no excuse for having everyone who wants to use such a
facility to have to write it explicitly. Perhaps you could post
the PL/I solution so that I could compare it to the Ada version.

-- 
LMTAS - "Our Brand Means Quality"
For more info, see http://www.lmtas.com or http://www.lmco.com




  parent reply	other threads:[~1996-11-22  0:00 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-11-05  0:00 Leading zeros with Int_IO.Put()? Or another package? J.D. Baldwin
1996-11-05  0:00 ` David Shochat
1996-11-08  0:00   ` robin
1996-11-08  0:00     ` Robert Dewar
1996-11-10  0:00       ` Verne Arase
1996-11-13  0:00       ` robin
1996-11-13  0:00         ` Ken Garlington
1996-11-19  0:00           ` robin
1996-11-19  0:00             ` Robert Dewar
1996-11-20  0:00             ` Richard A. O'Keefe
1996-11-20  0:00               ` robin
1996-11-20  0:00                 ` Larry J. Elmore
1996-11-25  0:00                   ` robin
1996-11-25  0:00                     ` Robert Dewar
1996-11-26  0:00                     ` Larry J. Elmore
1996-11-20  0:00                 ` Richard A. O'Keefe
1996-11-22  0:00                   ` robin
1996-11-22  0:00                     ` Richard A. O'Keefe
1996-11-23  0:00                       ` robin
1996-11-20  0:00                 ` Robert Dewar
1996-11-22  0:00                   ` Richard A. O'Keefe
1996-11-25  0:00                   ` shmuel
1996-11-21  0:00                 ` Jerry Coffin
1996-11-22  0:00                 ` Ken Garlington
1996-11-20  0:00               ` Robert Dewar
1996-11-20  0:00             ` Norman H. Cohen
1996-11-22  0:00             ` Ken Garlington [this message]
1996-11-27  0:00               ` Verne Arase
1996-12-02  0:00                 ` Ken Garlington
     [not found]             ` <56tjrh$4a <MPLANET.3294c204jcoffin989a3e@news.rmi.net>
1996-11-24  0:00               ` Bert
1996-11-13  0:00       ` robin
1996-11-13  0:00         ` Ken Garlington
1996-11-19  0:00           ` robin
1996-11-22  0:00             ` Ken Garlington
1996-11-22  0:00             ` Robert Dewar
1996-11-17  0:00         ` Robert Dewar
1996-11-08  0:00     ` Ken Garlington
1996-11-21  0:00   ` Robert I. Eachus
1996-11-22  0:00     ` robin
1996-11-05  0:00 ` Samuel Tardieu
1996-11-06  0:00 ` Robert I. Eachus
1996-11-08  0:00   ` Norman H. Cohen
1996-11-06  0:00 ` Stephen Leake
1996-11-06  0:00 ` Norman H. Cohen
1996-11-07  0:00   ` Pascal Obry
1996-11-07  0:00     ` Norman H. Cohen
1996-11-08  0:00   ` Norman H. Cohen
1996-11-09  0:00     ` Robert Dewar
1996-11-08  0:00 ` David Emery
1996-11-24  0:00 ` Fergus Henderson
1996-11-24  0:00   ` Robert Dewar
1996-11-25  0:00     ` J. David Bryan
1996-11-25  0:00     ` Larry Kilgallen
1996-11-27  0:00     ` Verne Arase
1996-11-28  0:00   ` Richard A. O'Keefe
  -- strict thread matches above, loose matches on Subject: below --
1996-12-15  0:00 Robert Dewar
1996-11-05  0:00 Collection of 2500+ links about Object-Orientation - interested ? Manfred Schneider
1996-11-07  0:00 ` Leading zeros with Int_IO.Put()? Or another package? John Herro
1996-11-07  0:00   ` James Rogers
1996-11-07  0:00   ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox