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: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Leading zeros with Int_IO.Put()? Or another package? Date: 1996/11/20 Message-ID: #1/1 X-Deja-AN: 197725174 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> <56tjrh$4ak$1@goanna.cs.rmit.edu.au> <56trsm$f5a$1@goanna.cs.rmit.edu.au> organization: New York University newsgroups: comp.lang.ada,comp.lang.pl1 Date: 1996-11-20T00:00:00+00:00 List-Id: robin says " >and I find that it beats PL/I as well. On this we don't." well of course Robin thinks PL/1 is more readable than Ada 95. It's like asking a Russian who barely speaks English whether he finds Russian easier to read than English. Robin has made it very clear that he is not very familiar with Ada 95. It always puzzles me when people spend so much time fulminating about programming languages that they know very little about, but it's typical of the programming language field. So you can't pay too much attention to robin's opinions on Ada 95, and equally it is probably the case that a lot of people contributing to this thread do not know PL/1 very well either. What is most missing from Robin's understanding of Ada 95 is the concept of abstraction. This is pretty much missing of course in PL/1, a rather old language, derived from Fortran, Algol and COBOL, so what do you expect? But it does mean that he does not appreciate that if an abstraction is useful it would be written once, and what is important is the readability, and usability of the interface specification, not whether there are 10 lines in the body or 1000. Let's go back to the original question, which was the issue of how to print an integer with leading zeroes suppressed. The answer in Ada 95 is that you use the Image_ZP function: function Image_ZP (X : Integer) return String; Well that's easy enough, Ah ha! says Robin, but look at the body of that function, its xxx lines long and voila! I can do this in one line in PL/1. Maybe true, but the answer is so what? Robin is like the APL programmer who thinks it is wonderful that sorting is built into APL as a primitive. Ultimately the issue of how reusable interfaces are constructed is FAR more important than what particular collectoin of primitives have been built into the language. Note for example that the picture editing in PL/1 is actually *built in* to the language, seems pretty horrible to me. In Ada 95, the picture editing is simply an add-on abstraction. Yes, it happens to be one of the predefined add-on abstractions, but that's a relatively minor point. Richard says that he concedes that it is too bad that the picture editing does not work for integers, but only for decimal. I can't see that as significant, it is trivial to extend the abstraction to cover the integer case if this is useful.