From: rav@goanna.cs.rmit.edu.au (robin)
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: <56trsm$f5a$1@goanna.cs.rmit.edu.au> (raw)
In-Reply-To: 56tjrh$4ak$1@goanna.cs.rmit.edu.au
ok@goanna.cs.rmit.edu.au (Richard A. O'Keefe) writes:
>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.
---It is abundantly clear that it failed as to ease of writing.
Various postings suggested that the conversion could be done in up to
82 lines of Ada code, whereas PL/I requires one simple line.
>I have used a great many programming languages,
Haven't we all!
>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,
On this we agree.
>and I find that it beats PL/I as well.
On this we don't.
>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*.
But they do, and there were various postings all giving different
ways to accomplish it in Ada.
>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 in a 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.
Those (COBOL and PL/I) were only examples. Even BASIC has it.
>Also add Ada 95.
Only if it's implemented.
>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.
Only where Ada supports a CoBOL or PL/I equivalent, as you
admit below.
>>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.
There is considerable difference -- in favor of PL/I -- between the
two. After all, you have demonstrated it!
>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".
???????
Now why would you bury a picture specification in a remote place from
the output statement that uses it?
>>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.
A facility that's available in IBM's PL/I for OS/2, Windows 95/NT and
AIX.
>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.
Thank you for proving the point! PL/I's
put edit (d) (P'-999,999,999');
is a lot simpler. What's more, you don't have to hunting for
Decimal_Integer to find out what it does.
P.S. Check out PL/I's drifting user-specifiable currency symbols etc
for picture editing. Great fun!
>Richard A. O'Keefe; http://www.cs.rmit.edu.au/%7Eok; RMIT Comp.Sci.
next prev 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-22 0:00 ` Ken Garlington
1996-11-22 0:00 ` Robert Dewar
1996-11-17 0:00 ` Robert Dewar
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 [this message]
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 ` Robert Dewar
1996-11-22 0:00 ` Richard A. O'Keefe
1996-11-25 0:00 ` shmuel
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-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-08 0:00 ` Ken Garlington
1996-11-21 0:00 ` Robert I. Eachus
1996-11-22 0:00 ` robin
1996-11-06 0:00 ` Robert I. Eachus
1996-11-08 0:00 ` Norman H. Cohen
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-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-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