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!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Thu, 30 Jun 2005 13:56:13 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1120092264.749327.16210@z14g2000cwz.googlegroups.com> <1120141150.107320.139080@f14g2000cwb.googlegroups.com> <42c40313$0$32193$39cecf19@news.twtelecom.net> Subject: Re: How difficult is ada to learn? Date: Thu, 30 Jun 2005 13:59:20 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-yrGgofGHlttkqzW4j8QltIqLCVk5Zmm2bw0MYb50rcrSNj9hwl0y0DuOeiBDinZVRkRpZocuFXXenTT!vM7yLT3MPbs0ELUOo7RCfkb8ycx3/yi5BMPQvpH28QN+YsbgcjvAFhh5DrvN4pCQnsaMpxoA7XZo X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:11772 Date: 2005-06-30T13:59:20-05:00 List-Id: "Matthew Heaney" wrote in message news:42c40313$0$32193$39cecf19@news.twtelecom.net... Matt Heaney wrote: > 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: The following example seems pretty confused. > type Integer_Array is array (Positive range <>) of Integer; > > function "+" (IA : Integer) return Integer_Sets.Set is What's the definition of "Integer_Sets.Set"? Shouldn't IA have type Integer_Array, rather than Integer? > 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); Presuming that Integer_Sets.Set has "or" and "and" operations. Randy.