Re: How to overload == for System.Double
Alan Baljeu <[email protected]> Sun, 4 Feb 2007 08:53:04 -0500
| Newsgroups | gmane.comp.windows.devel.dotnet.cx |
|---|---|
| Message-ID | <093b01c74863$caabd710$1dc80ac6@CTI> |
> -----Original Message----- > From: Discussion relating to the specifics of the C# and > Managed C++ languages [mailto:[email protected]] > On Behalf Of Peter Ritchie > Sent: Saturday, February 03, 2007 8:24 PM > To: [email protected] > Subject: Re: [DOTNET-CX] How to overload == for System.Double > > 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. > By not using tons of keywords like VB. They made anonymous functions and lambda expressions. The query methodology could have been built directly on that without tons of new keywords. Besides, SQL is ugly. A lot of research went into database technology, but I deny that real research went into the SQL language. It was just invented as an ad-hoc, easy to understand language, which becomes quite arcane quickly when it gets complicated. =================================== This list is hosted by DevelopMentorĀ® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com