comp.lang.ada
 help / color / mirror / Atom feed
* Type NATURAL isn't
@ 1988-06-23 18:08 Scott Simpson
  1988-06-24 14:45 ` Dennis Doubleday
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Scott Simpson @ 1988-06-23 18:08 UTC (permalink / raw)


Can anybody explain why the LRM declares NATURAL as
    
    subtype NATURAL is INTEGER range 0..INTEGER'LAST;

Natural numbers start at 1!  Any mathematician would assume it
to be the same declaration as POSITIVE.  A better solution would
be
    subtype WHOLE is INTEGER range 0..INTEGER'LAST;

You might argue that I could make the declarations

    subtype WHOLE is NATURAL;
    subtype NATURAL is STANDARD.NATURAL range 1..INTEGER'LAST;

but then any Ada programmer who reads my code will get thoroughly
confused.  I talked to my boss, Frank Belz, and he said that when Ada
was being developed, a number of people complained that they thought
of natural numbers as starting at zero so they made the language that
way.  This is clearly incorrect.
	Scott Simpson
	TRW Space and Defense Sector
	...{decvax,ihnp4,ucbvax}!trwrb!simpson  (UUCP)
	trwrb!simpson@trwind.trw.com		(Internet)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1988-06-28 20:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1988-06-23 18:08 Type NATURAL isn't Scott Simpson
1988-06-24 14:45 ` Dennis Doubleday
1988-06-27 15:49   ` Larry Woods
1988-06-28 20:05     ` Walter E. Pohl
1988-06-24 17:50 ` Dave Nelson
1988-06-28 17:15   ` stt
1988-06-25  0:06 ` Steven Ryan

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