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: a07f3367d7,cd3701d5ec722b08 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news2.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!newsfe06.iad.POSTED!7564ea0f!not-for-mail From: Brad Moore User-Agent: Thunderbird 2.0.0.23 (X11/20090817) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Lambda expressions? LINQ? References: <9b330aae-2c83-4d1c-995b-192425cd1c52@m11g2000vbl.googlegroups.com> <030adeb6-23c6-407e-8ac8-d0470fcbc3c0@o21g2000vbl.googlegroups.com> In-Reply-To: <030adeb6-23c6-407e-8ac8-d0470fcbc3c0@o21g2000vbl.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: NNTP-Posting-Host: 70.72.159.148 X-Complaints-To: internet.abuse@sjrb.ca X-Trace: newsfe06.iad 1253370911 70.72.159.148 (Sat, 19 Sep 2009 14:35:11 UTC) NNTP-Posting-Date: Sat, 19 Sep 2009 14:35:11 UTC Date: Sat, 19 Sep 2009 08:35:16 -0600 Xref: g2news2.google.com comp.lang.ada:8393 Date: 2009-09-19T08:35:16-06:00 List-Id: Martin wrote: > On Sep 19, 3:33 am, "Steve D" wrote: > [snip] >> As Martin guessed it is one statement spread over a few lines. >> >> string[] names = xDoc.Descendants("Layer0Message") >> .SelectMany(node => >> node.Attribute("To").Value.Split(' ',',').Where( st => st.Length > 0 )) >> .Distinct().OrderBy(n=>n).ToArray(); >> >> Oh, and by the way. LINQ isn't just for XML. You can do queries on arrays, >> lists, etc. For example if you have an array of records you can do a >> query to select all of the records with a field that has a particular >> value. It's cool. >> I just wish my favoriate language had this feature. > > Me too - although I can't see how it could be :-( I'm not sure I see why this couldn't be. At first glance, the code fragment looks a lot like Ada. If existing packages (such as XML/Ada see (http://libre.adacore.com/libre/tools/xmlada/) do not already have this capability, then why couldn't someone write such a package in Ada? I don't see the language being a barrier here. Ada.Containers.Vectors for example lets you query an array of records to select all the records with a field that has a particular value. What is missing? Brad