From: Brad Moore <brad.moore@shaw.ca>
Subject: Re: Lambda expressions? LINQ?
Date: Sat, 19 Sep 2009 08:35:16 -0600
Date: 2009-09-19T08:35:16-06:00 [thread overview]
Message-ID: <z_5tm.58012$4t6.57033@newsfe06.iad> (raw)
In-Reply-To: <030adeb6-23c6-407e-8ac8-d0470fcbc3c0@o21g2000vbl.googlegroups.com>
Martin wrote:
> On Sep 19, 3:33 am, "Steve D" <nospam_steve...@comcast.net> 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
next prev parent reply other threads:[~2009-09-19 14:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-16 2:23 Lambda expressions? LINQ? Steve D
2009-09-16 8:03 ` Georg Bauhaus
2009-09-16 10:46 ` Jeffrey R. Carter
2009-09-18 1:59 ` Steve D
2009-09-18 5:23 ` sjw
2009-09-19 2:33 ` Steve D
2009-09-19 6:50 ` Martin
2009-09-19 14:35 ` Brad Moore [this message]
2009-09-19 16:38 ` Martin
2009-09-18 13:42 ` Jeffrey R. Carter
2009-09-18 15:45 ` Martin
2009-09-18 7:58 ` Martin
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox