<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://code.msdn.microsoft.com/rss.xsl"?><rss version="2.0"><channel><title>csharpfuture Forum Rss Feed</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/List.aspx</link><description>csharpfuture Forum Rss Description</description><item><title>NEW POST: Dynamic interface implementation, asif/islike operators</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2509</link><description>&lt;div class="wikidoc"&gt;
I posted an idea on the MS Connect site (https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=476545) a while ago, but I'll post it here as well, since it seems more active and it would be nice to see if someone knows a way to do it with the current framework. I think it should be possible, but I haven't given it much thought. Here it is:&lt;br /&gt; &lt;br /&gt;Similar to the &amp;quot;as&amp;quot; operator I would like to have an &amp;quot;asif&amp;quot; operator. It would work just as the &amp;quot;as&amp;quot; operator, but only on interfaces and the big difference is that the instance type doesn't really implement the interface. The &amp;quot;asif&amp;quot; operator would return null if the instance type doesn't implement the same members as the wanted interface, but it returns the instance wrapped as the wanted interface if it does. An &amp;quot;islike&amp;quot; operator could similar to the &amp;quot;is&amp;quot; operator. &lt;br /&gt; &lt;br /&gt;var interfaceType = anyType asif INotImplementedInterface;&lt;br /&gt;I haven't really looked into the new dynamic type that much, but this way you could do a check that the instance isn't null, and only continue if it isn't. With the dynamic type you would get an error at runtime, right?&lt;br /&gt;
&lt;/div&gt;</description><author>tomen130</author><pubDate>Fri, 06 Nov 2009 08:28:45 GMT</pubDate><guid isPermaLink="false">NEW POST: Dynamic interface implementation, asif/islike operators 20091106A</guid></item><item><title>NEW POST: Make curly bracket assignment more general</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2501</link><description>&lt;div class="wikidoc"&gt;
Make { } assigning more general. Today it only works on constructors, it should work on any function call. &lt;br /&gt;Today you can not do curly bracket assignment, if an object i made in eg. af factory. Therefore is factory pattern not nice to use in a linq expression&lt;br /&gt; &lt;br /&gt;    class Foo&lt;br /&gt;    {&lt;br /&gt;        public string Name;&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;    class Factory&lt;br /&gt;    { &lt;br /&gt;        static public Foo CreateFoo()&lt;br /&gt;        {&lt;br /&gt;            return new Foo();&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt; &lt;br /&gt;new Foo{ Name = &amp;quot;test&amp;quot; } // constructor assigning is possible today&lt;br /&gt; &lt;br /&gt;It should also be possible to assign members after af function call, like this:&lt;br /&gt; &lt;br /&gt;Factory.CreateFoo(){ Name = &amp;quot;test&amp;quot; } //should be possible in the future&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>z5ivan</author><pubDate>Wed, 04 Nov 2009 10:44:30 GMT</pubDate><guid isPermaLink="false">NEW POST: Make curly bracket assignment more general 20091104A</guid></item><item><title>NEW POST: [Suggestion] Support of inline ASM or at least pre-defined classes for SIMD Extensions</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2441</link><description>&lt;div class="wikidoc"&gt;
Hello,&lt;br /&gt; &lt;br /&gt;I program applications that require 3D computation, and I really miss something in C# that could take advantage of SIMD (SSE2 and 3DNow!) instructions.&lt;br /&gt;It's such an important thing, and my C# code cannot get close to raw C++ performance. For example, matrix multiplications are about 30%-40% slower in C# than in C++.&lt;br /&gt;I noticed Mono has support for SIMD, I really hope .NET will have too !&lt;br /&gt; &lt;br /&gt;The ideal would be something like asm { } from C/C++, but a simpler thing (for .NET developpers) would be creating Matrix classes that use SIMD instructions, that we could use.&lt;br /&gt; &lt;br /&gt;Please think about it :)&lt;br /&gt; &lt;br /&gt;Thank you,&lt;br /&gt;Heandel&lt;br /&gt;
&lt;/div&gt;</description><author>Heandel</author><pubDate>Sat, 24 Oct 2009 17:29:54 GMT</pubDate><guid isPermaLink="false">NEW POST: [Suggestion] Support of inline ASM or at least pre-defined classes for SIMD Extensions 20091024P</guid></item><item><title>NEW POST: Reducing Syntactic Noise: Auto Generation of Boilerplate Code</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2192</link><description>&lt;div class="wikidoc"&gt;
It is too late.&lt;br /&gt; &lt;br /&gt;I once wrote a library that had similar requirements for event routing and bindable properties without having access to the WPF libraries and without inheriting from FrameworkElement. As it turns out, all those extra steps that WPF make you do are necessary and minimal in solving the problem.&lt;br /&gt; &lt;br /&gt;One way this could have been resolved is if dependency properties and routed and weak events (or at least INotifyPropertyChanged and INotifyCollectionChanged) had been implemented in the BCL rather than in WPF. But that hasn't been the case, so it's somewhat impossible for any latter version of C# to support this sort of functionality syntactically, and there are no standard interfaces or libraries that library developers could use to gain this sort of functionality outside of WPF or WF.&lt;br /&gt; &lt;br /&gt;I don't remember when or where, but someone from Microsoft responded that the issue is by design -- which is obviously a spin. There's no way that this functionality wouldn't be useful outside of WPF. It's really because WPF isn't really part of .NET despite the frustrating misnomer, and because there's no communication between the BCL team and the WPF team.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt;The good news though is that you could try a language like Boo, which has syntactical extensibility. I haven't looked into it myself, but it should at least cut down the boilerplate code. Of course, there probably aren't any good WPF designers that support Boo.&lt;br /&gt;
&lt;/div&gt;</description><author>reinux</author><pubDate>Thu, 15 Oct 2009 09:39:09 GMT</pubDate><guid isPermaLink="false">NEW POST: Reducing Syntactic Noise: Auto Generation of Boilerplate Code 20091015A</guid></item><item><title>NEW POST: Reducing Syntactic Noise: Auto Generation of Boilerplate Code</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2192</link><description>&lt;div class="wikidoc"&gt;
As the time goes by, my desire for an intelligent boilerplate code generation facility becomes stronger and stronger. I probably would not call it &amp;quot;macros&amp;quot;, since this became almost a swear word due to the bad fame of C macros. But just because C macros are bad, does not mean that we should allow ourselves to get buried in the syntactic noise.&lt;br /&gt; &lt;br /&gt;Boilerplate code is verbose and repetitive, and it distracts the reader from the main purpose of the program, thus &lt;b&gt;reducing&lt;/b&gt; the readability. The classic example of boilerplate code is &amp;quot;straight-through&amp;quot; properties in earlier version of C#:&lt;br /&gt; &lt;br /&gt;private int _totalCount;&lt;br /&gt;public int TotalCount { get { return _totalCount; } set { _totalCount = value; } }&lt;br /&gt; &lt;br /&gt;This became so big an annoyance, that newer versions of C# introduced a special shortcut:&lt;br /&gt; &lt;br /&gt;public int TotalCount { get; set; }&lt;br /&gt; &lt;br /&gt;This is good, but this is only one special case. Look how much code needs to be written for a WPF dependency property: &lt;a href="http://www.ikriv.com/blog/?p=264" class="externalLink"&gt;http://www.ikriv.com/blog/?p=264&lt;span class="externalLinkIcon"&gt;&lt;/span&gt;&lt;/a&gt;. &lt;br /&gt; &lt;br /&gt;   public static readonly DependencyProperty CenterProperty =&lt;br /&gt;            DependencyProperty.Register(&amp;quot;Center&amp;quot;, typeof(Point3D), typeof(Sphere),&lt;br /&gt;                new PropertyMetadata(new Point3D(0, 0, 0), CenterChanged));&lt;br /&gt; &lt;br /&gt;        public Point3D Center&lt;br /&gt;        {&lt;br /&gt;            get { return (Point3D)GetValue(CenterProperty); }&lt;br /&gt;            set { SetValue(CenterProperty, value); }&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;        private static void OnCenterChanged(Object sender, DependencyPropertyChangedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            Sphere s = ((Sphere)sender);&lt;br /&gt;            s.DoUpdateWhenCenterChanges();&lt;br /&gt;        }&lt;br /&gt; &lt;br /&gt;This is &lt;b&gt;a lot&lt;/b&gt; of code that repeats itself over and over again. I do want to be able to replace it with something like&lt;br /&gt; &lt;br /&gt;&lt;a href="http://code.msdn.microsoft.com/csharpfuture/Wiki/View.aspx?title=DependencyProperty"&gt;DependencyProperty&lt;/a&gt;&lt;br /&gt;Point3D Center { get; set; }&lt;br /&gt; &lt;br /&gt;Of course, one cannot throw support for all one-off cases into the language. We need a generic boilrerplate code generation facility, maybe something similar to LISP macros. Yes, I know that LISP macros can work only in an interpreted language, I am talking conceptually here. &lt;br /&gt; &lt;br /&gt;Of course, there are code generation tools out there that would happily create boilerplate code snippets for you. But this is only 10% of the issue. Typically, once generated, the snippets cannot be maintained, and they do not improve readability. Generating snippets is a one-time deal, and I don't consider it a real solution.&lt;br /&gt; &lt;br /&gt;If anyone in C# team feels the same way I do, we can work out a meaningful proposal, unless it is too late :)&lt;br /&gt;
&lt;/div&gt;</description><author>ivank</author><pubDate>Thu, 27 Aug 2009 14:58:51 GMT</pubDate><guid isPermaLink="false">NEW POST: Reducing Syntactic Noise: Auto Generation of Boilerplate Code 20090827P</guid></item><item><title>NEW POST: Instead Of Macro</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2141</link><description>&lt;div class="wikidoc"&gt;
As C# won't have a macro system...and it is not good (IMO &amp;amp; Taste) for DSLs, I think these are harmless features that give me a great bunch of what I like:&lt;br /&gt;- defining infix, generic operators  and functions&lt;br /&gt;- statically and dynamically typed protocols(duck typing, anonymous interface implementation, proxies, ... whatever you call it and every derivation you like)&lt;br /&gt; &lt;br /&gt;And everything can be verified at compile time (not as horrifying thing like Lisp macros...yet this `dynamic` part of C# 4.0...anyway); for example I can define an infix function 'feed_into':&lt;br /&gt; &lt;br /&gt;IItem item =...;&lt;br /&gt;IRSSFeed feed =...;&lt;br /&gt;item feed_into feed;&lt;br /&gt; &lt;br /&gt;Or a more generic one or even an operator like ??? (Ok; I can live with just infix syntax for functions).&lt;br /&gt; &lt;br /&gt;(I had my other long lists too; but here I emphasis on some syntax extending facilities or some tools that mock  syntax extending)&lt;br /&gt;
&lt;/div&gt;</description><author>kaveh_shahbazian</author><pubDate>Wed, 12 Aug 2009 10:55:33 GMT</pubDate><guid isPermaLink="false">NEW POST: Instead Of Macro 20090812A</guid></item><item><title>NEW POST: Suggestion: introduce 'nameof' key word to get string names of method arguments, properties and etc.</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2062</link><description>&lt;div class="wikidoc"&gt;
You can probably build a utility that does this via expression trees. For instance, you could define a method that takes an arbitrary expression tree and simply return the expression as a string. &lt;br /&gt; &lt;br /&gt;I'm not a .net/c# programmer, but from what I know of the language it might go something like this:&lt;br /&gt; &lt;br /&gt;  public String nameof( Expression&amp;lt;Func&amp;lt;object&amp;gt;&amp;gt; expr )&lt;br /&gt;  {&lt;br /&gt;     return expr.ToString();&lt;br /&gt;  }&lt;br /&gt; &lt;br /&gt;Using your example:&lt;br /&gt; &lt;br /&gt;  throw new ArgumentNullException( arg1, nameof( ()=&amp;gt;arg1 ) );&lt;br /&gt; &lt;br /&gt;Questions:&lt;br /&gt;- Can the lambda syntax omit the '()'? e.g., =&amp;gt;arg1 instead of ()=&amp;gt;arg1 &lt;br /&gt;- Will the new covariance rules in c# 4.0 allow Expression&amp;lt;Func&amp;lt;object&amp;gt;&amp;gt; to work?&lt;br /&gt;
&lt;/div&gt;</description><author>rsmckinney</author><pubDate>Thu, 06 Aug 2009 02:49:10 GMT</pubDate><guid isPermaLink="false">NEW POST: Suggestion: introduce 'nameof' key word to get string names of method arguments, properties and etc. 20090806A</guid></item><item><title>NEW POST: vNext Idea - Taking Initializer Notation a Step Further</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2120</link><description>&lt;div class="wikidoc"&gt;
I'd like the ability to set properties of an object via &amp;quot;initializer&amp;quot; notation whenever I have any reference to it, not just at construction.&lt;br /&gt;Currently:&lt;br /&gt; &lt;br /&gt;var car = new Car() { Doors = 4, Type = Types.Convertible, Spare = Spares.FullSize, License = &amp;quot;123ABC&amp;quot; };&lt;br /&gt; &lt;br /&gt;and if not constructing, then:&lt;br /&gt; &lt;br /&gt;var car = GiveMeACar();&lt;br /&gt;car.Doors = 4;&lt;br /&gt;car.Type = Types.Convertible;&lt;br /&gt;car.Spare = Spares.FullSize;&lt;br /&gt;car.License = &amp;quot;123ABC&amp;quot; ;&lt;br /&gt; &lt;br /&gt;I would like to see something like:&lt;br /&gt; &lt;br /&gt;var car = GiveMeACar();&lt;br /&gt;car set { Doors = 4, Type = Types.Convertible, Spare = Spares.FullSize, License = &amp;quot;123ABC&amp;quot; };&lt;br /&gt; &lt;br /&gt;or simply:&lt;br /&gt; &lt;br /&gt;car { Doors = 4, Type = Types.Convertible, Spare = Spares.FullSize, License = &amp;quot;123ABC&amp;quot; };&lt;br /&gt; &lt;br /&gt;this allows chaining:&lt;br /&gt; &lt;br /&gt;var car = GiveMeACar() { Doors = 4, Type = Types.Convertible, Spare = Spares.FullSize, License = &amp;quot;123ABC&amp;quot; };&lt;br /&gt;
&lt;/div&gt;</description><author>tah9m9</author><pubDate>Wed, 05 Aug 2009 19:18:23 GMT</pubDate><guid isPermaLink="false">NEW POST: vNext Idea - Taking Initializer Notation a Step Further 20090805P</guid></item><item><title>NEW POST: Suggestion: introduce 'nameof' key word to get string names of method arguments, properties and etc.</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=2062</link><description>&lt;div class="wikidoc"&gt;
Introduce 'nameof' key word that would return string representation of identifier in C# code. E.g. currently for argument check we need implement something like this:&lt;br /&gt;if (arg1 == null)&lt;br /&gt;{&lt;br /&gt;   throw new ArgumentNullException(arg1, &amp;quot;arg1&amp;quot;);&lt;br /&gt;}&lt;br /&gt;Then is someone renames arg1 into e.g. arg2, ArgumentNullException constructor could still have &amp;quot;arg1&amp;quot; as name of an argument. To avoid such Inconsistency it will be nice to have mechanism that returns string name of identifier. Then this sample code could look like:&lt;br /&gt;if (arg1 == null)&lt;br /&gt;{&lt;br /&gt;   throw new ArgumentNullException(arg1, nameof(arg1));&lt;br /&gt;}&lt;br /&gt;The same issue can be addressed to usage of interface INotifyPropertyChanged:&lt;br /&gt;public string PhoneNumber&lt;br /&gt;{&lt;br /&gt;   get&lt;br /&gt;   {&lt;br /&gt;     return this.phoneNumberValue;&lt;br /&gt;   }&lt;br /&gt;   set&lt;br /&gt;   {&lt;br /&gt;      if (value != this.phoneNumberValue)&lt;br /&gt;      {&lt;br /&gt;         this.phoneNumberValue = value;&lt;br /&gt;         NotifyPropertyChanged(nameof(PhoneNumber));&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>stasetz</author><pubDate>Thu, 23 Jul 2009 07:26:47 GMT</pubDate><guid isPermaLink="false">NEW POST: Suggestion: introduce 'nameof' key word to get string names of method arguments, properties and etc. 20090723A</guid></item><item><title>NEW POST: Symbol</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1988</link><description>&lt;div class="wikidoc"&gt;
I think that C# need Symbols like Ruby, this is a great way to do any things.&lt;br /&gt;
&lt;/div&gt;</description><author>bfscordeiro</author><pubDate>Mon, 06 Jul 2009 04:10:51 GMT</pubDate><guid isPermaLink="false">NEW POST: Symbol 20090706A</guid></item><item><title>NEW POST: C# vNext Idea - Delegate Interface Implementation</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1970</link><description>&lt;div class="wikidoc"&gt;
This one is complicated and there are OO patterns for accomplishing this; but as C# moves in a more Functional direction, I've had the desire a few times for the ability to implement interfaces through classes using delegate members to fulfill the interface contract.  See example:&lt;br /&gt; &lt;br /&gt;interface IRunnable&lt;br /&gt;{&lt;br /&gt;    void Run();&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;public class Runner : IRunnable&lt;br /&gt;{&lt;br /&gt;    public Action Run { get; set; } // matches the Run contract defined in IRunnable&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;Action run = () =&amp;gt; Console.WriteLine(&amp;quot;Running...&amp;quot;);&lt;br /&gt; &lt;br /&gt;var runnable = new Runner() { Run = run };&lt;br /&gt;runable.Run();&lt;br /&gt;
&lt;/div&gt;</description><author>tah9m9</author><pubDate>Wed, 01 Jul 2009 15:49:14 GMT</pubDate><guid isPermaLink="false">NEW POST: C# vNext Idea - Delegate Interface Implementation 20090701P</guid></item><item><title>NEW POST: C# vNext Idea - Anonymous Interface Implementation</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1969</link><description>&lt;div class="wikidoc"&gt;
One feature I'd like to see in a future version of C# is the ability to define an anonymous implementation of an interface.  See below:&lt;br /&gt; &lt;br /&gt;interface IRunnable&lt;br /&gt;{&lt;br /&gt;    void Run();&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;var runnable = new IRunnable() &lt;br /&gt;{&lt;br /&gt;    public void Run()&lt;br /&gt;    {&lt;br /&gt;        Console.WriteLine(&amp;quot;Running...&amp;quot;);&lt;br /&gt;        // Do your running&lt;br /&gt;    }&lt;br /&gt;};&lt;br /&gt; &lt;br /&gt;runnable.Run();&lt;br /&gt; &lt;br /&gt;This would be so handy for some quick dependency injection scenarios where I don't want to have to create a type that implements the interface and just write my functionality inline.  Imagine the possibilities when you factor in closures.&lt;br /&gt;
&lt;/div&gt;</description><author>tah9m9</author><pubDate>Wed, 01 Jul 2009 15:40:49 GMT</pubDate><guid isPermaLink="false">NEW POST: C# vNext Idea - Anonymous Interface Implementation 20090701P</guid></item><item><title>NEW POST: Suggesting a null safe member access operator</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1900</link><description>&lt;div class="wikidoc"&gt;
I have often wanted a way to abbreviate code such as:&lt;br /&gt; &lt;br /&gt;int? id = obj == null ? null : obj.id;&lt;br /&gt; &lt;br /&gt;Imagine an alternative member access operator, say the (!) exclamation mark, which allowed the following syntax:&lt;br /&gt; &lt;br /&gt;int? id = obj!id;&lt;br /&gt; &lt;br /&gt;This combines the converse of the ?? operator with member access.  In the case of ! a null would be returned as soon as an object reference turned out to be null; otherwise - in the case of a reference type - further member access could be pursued:&lt;br /&gt; &lt;br /&gt;int? len = obj!name!Length;&lt;br /&gt; &lt;br /&gt;The null safe member access would need to lift the type to its nullable equivalent, where the ultimate property is of a value type.&lt;br /&gt; &lt;br /&gt;An alternative syntax might be !? but ! would seem more elegant and familiar in this regard.&lt;br /&gt;
&lt;/div&gt;</description><author>ChrisH</author><pubDate>Sat, 20 Jun 2009 06:54:26 GMT</pubDate><guid isPermaLink="false">NEW POST: Suggesting a null safe member access operator 20090620A</guid></item><item><title>NEW POST: Suggestion: C# Functions</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1833</link><description>&lt;div class="wikidoc"&gt;
I can define a function C++ but not in C#. Consider the following C++ code:&lt;br /&gt; &lt;br /&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;   int MyFunction(int x, int y)&lt;br /&gt;   {&lt;br /&gt;      return x + y;&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   class MyClass&lt;br /&gt;   {&lt;br /&gt;   private:&lt;br /&gt;      std::string _name;&lt;br /&gt; &lt;br /&gt;   public:&lt;br /&gt;      std::string GetName() const {return _name;}&lt;br /&gt;      void SetName(std::string&amp;amp; name) { _name = name;}&lt;br /&gt;   };&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;I can do something similar with C# using a static class like so:&lt;br /&gt; &lt;br /&gt;namespace MyNamespace&lt;br /&gt;{&lt;br /&gt;   static class MyFunctions&lt;br /&gt;   {&lt;br /&gt;      static int MyFunction(int x, int y)&lt;br /&gt;      {&lt;br /&gt;         return x + y;&lt;br /&gt;      }&lt;br /&gt;   }&lt;br /&gt; &lt;br /&gt;   class MyClass&lt;br /&gt;   {&lt;br /&gt;      private string _name;&lt;br /&gt;      public string GetName() { return _name; }&lt;br /&gt;      public void SetName(string name) { _name = name; }&lt;br /&gt;   }&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;I like being able to have a function that isn't defined as a static method on a static class. I know that with a static class you can have static members that the method can refer to and you can't do that with a namespace... but there are many times when a function doesn't refer to any members. It would be nice if the language allowed me to express this in a straightforward way instead of requiring me to use a static class. Also, wouldn't this make exports from language that allow this (like F#) more natural to work with in C#?&lt;br /&gt;   &lt;br /&gt;
&lt;/div&gt;</description><author>algotron</author><pubDate>Thu, 04 Jun 2009 14:54:42 GMT</pubDate><guid isPermaLink="false">NEW POST: Suggestion: C# Functions 20090604P</guid></item><item><title>NEW POST: Language Assistance</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1780</link><description>&lt;div class="wikidoc"&gt;
I'm just curious,&lt;br /&gt; &lt;br /&gt;I'm writing a compiler framework for a language framework I'm trying to build.  I'm interested to know where I can find technical information on how to implement certain 4.0 features, such as baking the essential PIA into the target assembly, call-site embedding, runtime call-site resolution (for proper interop with other languages on the DLR).&lt;br /&gt; &lt;br /&gt;I know enough to realize that the entire thing won't be easy, and I'm also curious as to how to properly cache the call-site once it's resolved, is it cached per instance, per type, handled by the DLR itself, or some other mixture?  Perhaps there's something else I'm missing, because certain DLR languages have object instances that can self modify their method availability.&lt;br /&gt; &lt;br /&gt;Any response is appreciated.&lt;br /&gt;
&lt;/div&gt;</description><author>AlexanderMorou</author><pubDate>Mon, 25 May 2009 19:13:19 GMT</pubDate><guid isPermaLink="false">NEW POST: Language Assistance 20090525P</guid></item><item><title>NEW POST: Operator Overloading</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1738</link><description>&lt;div class="wikidoc"&gt;
When develop a set of mathematical classes I noticed a pattern in my coding:&lt;br /&gt;(These are generic examples)&lt;br /&gt; &lt;br /&gt;static public ReturnType operator + (InType1 left, InType2 right)&lt;br /&gt;{&lt;br /&gt;  ReturnType result = new ReturnType();&lt;br /&gt; &lt;br /&gt;  result.somemember = left.someothermember + right.yetanothermember;&lt;br /&gt; &lt;br /&gt;  return result;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;static public ReturnType operator - (InType1 left, InType2 right)&lt;br /&gt;{&lt;br /&gt;  ReturnType result = new ReturnType();&lt;br /&gt; &lt;br /&gt;  result.somemember = left.someothermember - right.yetanothermember;&lt;br /&gt; &lt;br /&gt;  return result;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;// Same operations but with the order of the input types reversed.&lt;br /&gt;static public ReturnType operator + (InType2 left, InType1 right)&lt;br /&gt;{&lt;br /&gt;  ReturnType result = new ReturnType();&lt;br /&gt; &lt;br /&gt;  result.somemember = left.someothermember + right.yetanothermember;&lt;br /&gt; &lt;br /&gt;  return result;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;static public ReturnType operator - (InType2 left, InType1 right)&lt;br /&gt;{&lt;br /&gt;  ReturnType result = new ReturnType();&lt;br /&gt; &lt;br /&gt;  result.somemember = left.someothermember - right.yetanothermember;&lt;br /&gt; &lt;br /&gt;  return result;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;This is suggestive of a type of templating. How about the following tokens?&lt;br /&gt; &lt;br /&gt;static public ReturnType operator +- (~ InType1 left, InType2 right)&lt;br /&gt;{&lt;br /&gt;  ReturnType result = new ReturnType();&lt;br /&gt; &lt;br /&gt;  result.somemember = left.someothermember +- right.yetanothermember;&lt;br /&gt; &lt;br /&gt;  return result;&lt;br /&gt;}&lt;br /&gt; &lt;br /&gt;Usage:&lt;br /&gt; &lt;br /&gt;InType1 first = new InType1();&lt;br /&gt;InType2 second = new InType2();&lt;br /&gt;ReturnType result;&lt;br /&gt; &lt;br /&gt;// Useless code of course, but works for the purpose of demonstration.&lt;br /&gt;result = first + second;&lt;br /&gt;result = second + first;&lt;br /&gt;result = first - second;&lt;br /&gt;result = second - first;&lt;br /&gt; &lt;br /&gt;The &amp;quot;&lt;u&gt;-&amp;quot;, &amp;quot;*/&amp;quot;, &amp;quot;&lt;/u&gt;-*/&amp;quot;, &amp;quot;&amp;lt;&amp;gt;&amp;quot;, etc. tokens inside the function block would indicate where the proper operator would be substituted. The &amp;quot;(~&amp;quot; would simply mean that the order of the arguments can be reversed. The compiler would essentially do this:&lt;br /&gt; &lt;br /&gt;function x(arg1 x, arg2 y) {...}&lt;br /&gt;function x(arg2 x, arg1 y) {return x(y,x);}&lt;br /&gt; &lt;br /&gt;This is simply much what the compiler does already for &amp;quot;+=&amp;quot;, &amp;quot;-=&amp;quot; and other automatically overloaded operators.&lt;br /&gt;
&lt;/div&gt;</description><author>Avel</author><pubDate>Sat, 16 May 2009 15:53:28 GMT</pubDate><guid isPermaLink="false">NEW POST: Operator Overloading 20090516P</guid></item><item><title>NEW POST: add reference</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1682</link><description>&lt;div class="wikidoc"&gt;
if any refernce error comes that time automatically add refernce to project.&lt;br /&gt;
&lt;/div&gt;</description><author>chandra2ravi</author><pubDate>Wed, 06 May 2009 08:08:12 GMT</pubDate><guid isPermaLink="false">NEW POST: add reference 20090506A</guid></item><item><title>NEW POST: Decompile C# Exe&amp;Dll</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1663</link><description>&lt;div class="wikidoc"&gt;
Are there any works in C# 4, for prevent &amp;quot;decompile exe and dll files&amp;quot; which are written in .NET ?&lt;br /&gt;I mean, I want to protect my exe and dll files from decompilers. I don't want to pay money to obfuscators.&lt;br /&gt;Has Microsoft Visual Studio 2010 compiler any new protection method for this ?&lt;br /&gt; &lt;br /&gt;Sorry for my bad English,&lt;br /&gt;Best Regards.&lt;br /&gt;
&lt;/div&gt;</description><author>MACIR</author><pubDate>Sun, 03 May 2009 04:06:11 GMT</pubDate><guid isPermaLink="false">NEW POST: Decompile C# Exe&amp;Dll 20090503A</guid></item><item><title>NEW POST: Suggestion: Enum</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1650</link><description>&lt;div class="wikidoc"&gt;
I want to derive one enum from another&lt;br /&gt;For example: I have some error codes and I need to extend enum with extended/additional codes.&lt;br /&gt;
&lt;/div&gt;</description><author>Gritcsenko</author><pubDate>Thu, 30 Apr 2009 09:23:54 GMT</pubDate><guid isPermaLink="false">NEW POST: Suggestion: Enum 20090430A</guid></item><item><title>NEW POST: New feature: Keyword 'that'</title><link>http://code.msdn.microsoft.com/csharpfuture/Thread/View.aspx?ThreadId=1054</link><description>&lt;div class="wikidoc"&gt;
Hhmm, nice idea.&lt;br /&gt;But if you use &amp;quot;class&amp;quot; instead, then it has to be &amp;quot;object&amp;quot; instead of &amp;quot;this&amp;quot; ;-)!&lt;br /&gt;
&lt;/div&gt;</description><author>MarioTP</author><pubDate>Fri, 17 Apr 2009 18:52:45 GMT</pubDate><guid isPermaLink="false">NEW POST: New feature: Keyword 'that' 20090417P</guid></item></channel></rss>