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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,103b407e8b68350b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-06 09:26:47 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!canoe.uoregon.edu!arclight.uoregon.edu!wn13feed!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Reply-To: "James S. Rogers" From: "James S. Rogers" Newsgroups: comp.lang.ada References: <3E147D79.2070703@cogeco.ca> <4519e058.0301031434.51a0c880@posting.google.com> Subject: Re: Anybody in US using ADA ? One silly idea.. X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 Message-ID: Date: Mon, 06 Jan 2003 17:26:45 GMT NNTP-Posting-Host: 12.86.33.237 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1041874005 12.86.33.237 (Mon, 06 Jan 2003 17:26:45 GMT) NNTP-Posting-Date: Mon, 06 Jan 2003 17:26:45 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:32624 Date: 2003-01-06T17:26:45+00:00 List-Id: "Wes Groleau" wrote in message news:YRhS9.215$Z74.921@dfw-service2.ext.raytheon.com... > > I don't know C++ very well, but this complaint > about Ada is true--at least partially. I do > understand C and Java, so I'll risk interpolating > to C++ .... > > Does C++ have subtypes and derived types? The lack Not in the Ada sense. C++, supporting OOP, does allow you to create your own classes and inherit from those classes. It does not allow you to create your own primitive types or derive directly from primitive types. C++ does not support anything like type Voltages is digits 15 range -4.0..40.; type Strange is new Integer range -123..1024; Nor does it support anything like subtype Natural is Integer range 0..Integer'Last; > of such in Java is really a pain. And these DO inherit > attributes from parent types. But I wish I could > define things like 'First and 'Last when I create a > private type for which they are meaningful. Of course, 'First and 'Last imply a range. Ranges imply discrete values. How would you describe the range for a type that is not discrete? This would imply the ability to define discontinuous ranges. Although that ability seems convenient for the programmer, I have no idea how it could be implemented by the compiler writer in an efficient and general manner. > It would also be nice to be able to redefine 'Size > for an access type or record containing an access type. > But these are minor issues. Defining 'Size for an access type would require a consistent implementation of access types across all compilers. Remember that an access type need not be implemented as a pointer. Ada makes a strong distinction between an access type and a value of type System.Address. Jim Rogers