comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Depending on passing mechanism
Date: 1997/10/24
Date: 1997-10-24T00:00:00+00:00	[thread overview]
Message-ID: <dewar.877698430@merv> (raw)
In-Reply-To: hbaker-2310970735010001@10.0.2.1


Henry says

<<I agree that Ada's attempts to provide accurate ranges of numbers are
laudable.  But PL/I and Cobol offered equally (some would say more
equally) powerful capabilities>>

  This is technical nonsense. I assume it means that Henry does not
  know COBOL. In COBOL, you can specify the precision of a number only
  by giving the number of digits (i.e. equivalent to the digits phrase
  in an Ada decimal declaration). There is no capability to declare a
  specific range, i.e. there is no equivalent in COBOL of the Ada
  declaration:

     type x is delta 0.01 digits 5 range 1.00 .. 123.67;

  The nearest that COBOL can come is

     PICTURE S999V99.
   
  which captures the delta and digits but not the range.

  In the binary case, the situation is even worse, since one can still only
  specify a range in decimal digits. The normal technique in COBOL is to
  write:

     05  FIELD1  COMP-4 PICTURE S9(4).

  and know that really the range of FIELD1 will be 16-bits signed and
  therefore have a range of -32768 .. +32767. All arithmetic with
  FIELD1 will be done without using the ON SIZE ERROR, and everything
  works out OK, but without proper error checking.

  Note also the limitation that in COBOL, even the decimal range is
  enforced only if every arithmetic operation specifies ON SIZE ERROR.

  The situation in PL/1 with respect to decimal types is identical to
  COBOL. The binary situation is better, since ranges can at least
  be given in powers of 2, but it is still not possible (at least
  in ANSI PL/1, who knows what has happened since) to specify 
  specific binary ranges.

  Anyone would say that COBOL and PL/1 offer "more powerful" capabilities
  in this area must presumably be as ignorant about COBOL and PL/1 as
  Henry obviously is.






  parent reply	other threads:[~1997-10-24  0:00 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-10-13  0:00 Depending on passing mechanism Andre Spiegel
1997-10-13  0:00 ` Matthew Heaney
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00 ` Robert Dewar
1997-10-14  0:00   ` Henry Baker
1997-10-15  0:00     ` Geert Bosch
1997-10-15  0:00       ` Robert Dewar
1997-10-15  0:00         ` Robert Dewar
1997-10-17  0:00           ` Andre Spiegel
1997-10-17  0:00             ` Henry Baker
1997-10-17  0:00               ` Robert I. Eachus
1997-10-17  0:00               ` Jon S Anthony
1997-10-21  0:00               ` Robert A Duff
1997-10-21  0:00                 ` Peter Hermann
1997-10-22  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Brian Rogoff
1997-10-22  0:00                 ` Henry Baker
1997-10-21  0:00                   ` Robert Dewar
1997-10-22  0:00                   ` Jon S Anthony
1997-10-22  0:00                   ` Brian Rogoff
1997-10-15  0:00         ` Brian Rogoff
1997-10-19  0:00           ` Robert Dewar
1997-10-22  0:00             ` Henry Baker
1997-10-15  0:00       ` Henry Baker
1997-10-15  0:00         ` Robert Dewar
1997-10-15  0:00         ` Jon S Anthony
1997-10-16  0:00         ` Brian Rogoff
1997-10-17  0:00           ` Henry Baker
1997-10-18  0:00             ` Fergus Henderson
1997-10-18  0:00             ` Brian Rogoff
1997-10-18  0:00               ` Matthew Heaney
1997-10-19  0:00                 ` Brian Rogoff
1997-10-21  0:00                   ` Robert A Duff
1997-10-22  0:00                     ` Robert Dewar
1997-10-22  0:00                       ` Brian Rogoff
     [not found]                         ` <dewar.877601826@merv>
1997-10-23  0:00                           ` Brian Rogoff
1997-10-23  0:00                       ` Henry Baker
1997-10-23  0:00                     ` Brian Rogoff
1997-10-19  0:00               ` Fergus Henderson
1997-10-19  0:00                 ` Brian Rogoff
1997-10-20  0:00                   ` Fergus Henderson
1997-10-20  0:00                 ` Henry Baker
1997-10-20  0:00                   ` Tucker Taft
1997-10-21  0:00                     ` Geert Bosch
1997-10-15  0:00     ` JP Thornley
1997-10-21  0:00     ` Robert A Duff
1997-10-22  0:00       ` Henry Baker
1997-10-21  0:00         ` Matthew Heaney
1997-10-22  0:00           ` Simon Wright
1997-10-23  0:00           ` Henry Baker
1997-10-23  0:00             ` Pat Rogers
1997-10-24  0:00             ` Robert Dewar [this message]
1997-10-23  0:00         ` Robert A Duff
1997-10-21  0:00   ` Keith Thompson
replies disabled

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