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!news3.google.com!news.glorb.com!newsfeeds.sol.net!posts.news.twtelecom.net!nnrp2.twtelecom.net!not-for-mail Date: Thu, 30 Jun 2005 10:34:59 -0400 From: Matthew Heaney Organization: On2 Technologies, Inc User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) 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> In-Reply-To: <1120141150.107320.139080@f14g2000cwb.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <42c40313$0$32193$39cecf19@news.twtelecom.net> NNTP-Posting-Date: 30 Jun 2005 14:34:59 GMT NNTP-Posting-Host: 23336311.news.twtelecom.net X-Trace: DXC=bIOI:6IIC\jjTVj9J;>TN`C_A=>8kQj6m=_1NR_H?JPmMOnPQP8MggddYZAA8S: Gene wrote: > > Most people who start with Borland Pascal miss the built-in set and > string data types. Ada gets the same effects with packages, but the > syntax is far less elegant and readable. I haven't done any Pascal in a while, so I don't remember the syntax for set manipulation, but Ada 2005 will have a set container type. It's an abstract data type, declared in a package in the normal way. It supports union, intersection, etc. If not having "built-in" syntax is a hardship, then you can always define array-based set operations yourself. For example, suppose we have a set whose element type is Integer, then we can do this: type Integer_Array is array (Positive range <>) of Integer; function "+" (IA : Integer) return Integer_Sets.Set is S : Set; begin for Indx in IA'Range loop S.Include (IA (Indx)); end loop; return S; end; Now you can say: declare S1 : Set := +(1, 2, 3); S2 : Set := +(2, 3, 4); S3 : Set := S1 or S2; S4 : Set := S3 and +(1, 3); S5 : Set := +(42, 43) or +(44, 45); begin ...; That's not that inelegant. Not much different from Pascal, as I recall...