Re: How to overload == for System.Double
Peter Ritchie <[email protected]> Sat, 3 Feb 2007 20:23:32 -0500
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <LISTSERV%[email protected]> |
Keep in mind, although the LINQ syntax takes much from SQL, it's not just
for database access, for example (stealing from Charlie Calvert):
string[] EinsteinQuote = new string[] {"space",
"detached", "from", "any",
"physical","content", "does", "not", "exist" };
IEnumerable<string> selectedWords =
from p in EinsteinQuote
where p.Equals("any") != true
select p;
foreach (string word in selectedWords)
{
Console.WriteLine(word);
}
Alot of research, experimentation, testing, etc. went into the SQL
language, it only makes sense to reuse that work implementing an inline
query syntax into an existing language, if you can.
How could you implement any extension to a language and still make it
resemble previous syntax? Remember, it's two parts: generating an
IEnumerable, then enumerating it with foreach; so, you couldn't extend
foreach... You'd to throw a new keyword or two in there; no point in
designing a syntax for queries when all the design is done for you.
On Fri, 2 Feb 2007 13:25:53 -0500, Alan Baljeu <[email protected]>
wrote:
> IEnumerable<string> expr = from s in names
> where s.Length == 5
> orderby s
> select s.ToUpper();
>
>Since when did this remotely resemble C#? I get the impression that the
syntax is all
>proprietary MS extensions, and only useful for SQL or whatever MS decides
they want to
>enhance. Bleah!
===================================
This list is hosted by DevelopMentorĀ® http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com