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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ee1a8b8db84c88f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newscon02.news.prodigy.com!newscon06.news.prodigy.com!prodigy.net!newsfeed-00.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Ada exception block does NOT work? Date: 19 Aug 2005 10:41:43 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <4301ab29$0$6989$9b4e6d93@newsread2.arcor-online.net> <%s2Ne.2$5F1.1@dfw-service2.ext.ray.com> <1124383129.977718.320820@g44g2000cwa.googlegroups.com> <1124388461.739578.189030@g14g2000cwa.googlegroups.com> <1124390687.309704.156800@g44g2000cwa.googlegroups.com> <1124413067.744497.224850@z14g2000cwz.googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1124462503 17418 192.74.137.71 (19 Aug 2005 14:41:43 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Fri, 19 Aug 2005 14:41:43 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:4188 Date: 2005-08-19T10:41:43-04:00 List-Id: "jimmaureenrogers@worldnet.att.net" writes: > Ada types do not require any storage. Instances of types require > storage. Well, *subtypes* require storage, which is really what matters for Hymen's point. > Ada also allows the definition of constrained array types. All > instances on a constrained array type have the same number of elements. > The size of all such instances is determined at compile time. No, actually, it can be determined at run time. For example: type Index is new Integer range 1..F(X); type T is array(Index) of Character; where F(X) is a function call that reads from the keyboard. All objects of type T have the same length, but that length is not known at compile time. Actually, there is one obscure exception: X: T := ...; Mid: Index := ...; X := X(Mid+1..X'Last) & X(X'First..Mid); There are two intermediate results that have other lengths. OK, OK, that's a nit. ;-) > ...Ada provides no implicit conversions between types. It does, but they're less error prone than those of C++. > Ada's type system is both very strong and static. Well, Ada does lots of checks at run time. They're not called "type checks", but if they were, would that make the language less safe? Would it mean Ada does dynamic type checking? > You can declare local Ada types in internal blocks, according to > the values of variables: > > procedure New_Type(Min, Max : Integer) is > type Local_Type is range Min..Max; That's illegal. Min and Max must be static. However, you could say: type Local_Type is new Integer range Min..Max; - Bob