comp.lang.ada
 help / color / mirror / Atom feed
From: ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe)
Subject: Re: Leading zeros with Int_IO.Put()? Or another package?
Date: 1996/11/20
Date: 1996-11-20T00:00:00+00:00	[thread overview]
Message-ID: <56tjrh$4ak$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 56rgou$r4k$1@goanna.cs.rmit.edu.au


rav@goanna.cs.rmit.edu.au (robin) writes:

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

This is not clear at all.
I have used a great many programming languages,
and find Ada to be _dramatically_ more readable (in terms of
how well I can read other people's code) than most of them.
It beats C and C++ by a country mile,
and I find that it beats PL/I as well.
One of the reasons is that conversions are explicit.

>No excuse for having everyone who wants to use such a facility
>to have to write it.

*BUT THEY DON'T*.

It is a common rhetorical device of yours, rav, to take a
true statement "someone must write X", and use the _false_
statement "everyone must write X" as a stick to beat Ada with.

>It is, after all, avalable ina number of languages including COBOL
>and PL/I.

We are specifically talking about converting numbers to text.
If you want a list of languages with such features,
add Burroughs Extended Algol, and Algol 68.
Also add Ada 95.

Have you looked at Annex F in the Ada 95 LRM?
It's on-line here, and quite a few staff members have printed copies.
Have you _tried_ the Annex F stuff?
We have GNAT, and the current GNAT documentation says all
the annexes are supported.
I _have_ tried picture editing in GNAT; it works fine, and it
is no harder and no easier to write Ada pictures than COBOL
or PL/I pictures.

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

Can I refute the usefulness of PL/I for this?
I cannot, and would not want to.
Can I refute the simplicity of PL/I for this?
Well, it depends on what you you mean.
As noted above, I don't find it any harder to write
Ada pictures than PL/I pictures, and I welcome the
level of detail in the ADA 95 LRM.
I've used pictures in Burroughs Algol, COBOL, and PL/I, and
the devil is in the details.
Concerning the actual _use_ of pictures, if you use named
pictures in PL/I, there is very little to chose.  If you
_don't_ use named pictures (by which I mean ones declared
in a PL/I DECLARE statement or an Ada object declaration)
then using "magic strings" is just as bad as using "magic
numbers".

>As I indicated earlier, just one short line will suffice! :

>put edit (d) (P'999.V999');

I note that Ada 95 pictures offer some features missing from COBOL-85
and that they're pretty useful.

I note that Ada 95 makes it pretty easy to read a picture from a file,
or compute on on the fly by some other method.  (In particular, from
the attributes of "d" in an example like this.)

I willingly concede that it is a nuisance that Ada 95 pictures apply to
decimal fixed point numbers, not integers or floating point numbers.
(In particular, Ada 95 pictures have no "exponent picture" support.)
I also willingly concede that waiting until run time to check pictures
whose strings are known at compile time is not what I would have chosen.

In the case of writing out integers with pictures,
I don't greatly mind having

	type Decimal_Integer is delta 1.0 digits 9;
	package Decimal_Integer_Editing is new
	   Ada.Text_IO.Editing.Decimal_Output(Decimal_Integer);
	use Decimal_Integer_Editing;

ONCE somewhere in a program (probably written by someone else) and
then doing

	Put(Decimal_Integer(X), To_Picture("-999_999_999"));

or whatever.  

-- 
Mixed Member Proportional---a *great* way to vote!
Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.




  parent reply	other threads:[~1996-11-20  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 ` Samuel Tardieu
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 [this message]
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
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             ` Robert Dewar
1996-11-22  0:00             ` Ken Garlington
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-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-06  0:00 ` Stephen Leake
1996-11-06  0:00 ` Robert I. Eachus
1996-11-08  0:00   ` Norman H. Cohen
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     ` Larry Kilgallen
1996-11-25  0:00     ` J. David Bryan
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-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
1996-12-15  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