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,aa8786249f0c751f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread1.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: Jeffrey Carter Organization: jrcarter commercial-at acm [period | full stop] org User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How difficult is ada to learn? References: <1120092264.749327.16210@z14g2000cwz.googlegroups.com> <1120141150.107320.139080@f14g2000cwb.googlegroups.com> <42c40952$0$32193$39cecf19@news.twtelecom.net> In-Reply-To: <42c40952$0$32193$39cecf19@news.twtelecom.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Fri, 01 Jul 2005 05:37:56 GMT NNTP-Posting-Host: 67.3.209.6 X-Complaints-To: abuse@earthlink.net X-Trace: newsread1.news.pas.earthlink.net 1120196276 67.3.209.6 (Thu, 30 Jun 2005 22:37:56 PDT) NNTP-Posting-Date: Thu, 30 Jun 2005 22:37:56 PDT Xref: g2news1.google.com comp.lang.ada:11800 Date: 2005-07-01T05:37:56+00:00 List-Id: Matthew Heaney wrote: > > Of course, sets of this type have the same constraints as Pascal, > meaning that the element type must be discrete and constrained, e.g. > subtypes of Character or Integer, etc. They don't have to be subtypes. In Pascal, there were often limits on the range of the universe, and the compiler would reject sets over too large a universe, but there's nothing in Ada to stop you from writing: type Character_Set is array (Character) of Boolean; pragma Pack (Character_Set); type Integer_Set is array (Integer) of Boolean; pragma Pack (Integer_Set); C : Character_Set; I : Integer_Set; and the worst the compiler can do is issue a warning that the declaration will raise Storage_Error. Actually, with a 32-bit Integer, Integer_Set will occupy 512 MB. That's less than the physical memory on many modern PCs, so you might not even get a warning. -- Jeff Carter "We call your door-opening request a silly thing." Monty Python & the Holy Grail 17