Browse by Tags

All Tags » C# 3.0 (RSS)
Introduction We’ve been talking about functional programming quite a bit already. One of the things used frequently in functional programming is recursion, instead of imperative loop constructs. Both have their advantages, but often recursive techniques...
Posted by bart | 50 comment(s)
With a hypothetical next release of the C# language around the corner (more about that after Anders, our language Caesar, has delivered his “Future of C#” talk on the PDC 08), I’ve had the honor to receive an early print of The C# Programming Language...
Note for purists: This post only speaks for “LINQ predicates”, not – although closely related to - the mathematic concept of a predicate as defined by Weisstein, Eric W. "Predicate." From MathWorld --A Wolfram Web Resource. http://mathworld...
Posted by bart | 8 comment(s)
Filed under: , ,
As a reference for some planned and unplanned future posts, I wanted to share out my “cheat sheet” for the C# 3.0 translation carried out for query expressions. Obviously it’s based on the C# 3.0 Language Specification more specially section 7.15.2. A...
Posted by bart | 10 comment(s)
Filed under: ,
Last time we talked about dealing with dynamic code generation using Reflection.Emit to generate calls to our dynamic binder. I’ve shown how to see the IL that gets generated by means of the Dynamic IL Visualizer add-in in Visual Studio. In this post...
Posted by bart | 7 comment(s)
Last time in this series we were able to compile a stunningly complex “dynamic lambda” x => x – also known as I in the world of combinators – into IL code at runtime. As that’s not particularly useful, we want to move on to slightly more complex expressions...
Posted by bart | 9 comment(s)
Welcome back to the dynamic expression tree fun. Last time we designed our simplified expression tree class library we’ll be using to enable dynamic treatment of objects. Today, we’ll take this one step further by emitting IL code that resolves the operations...
Posted by bart | 6 comment(s)
In the previous post, I outlined the use of the expression trees from the System.Linq.Expressions namespace. Let’s recap to set the scene: Expression < Func < string , int , int , string >> data = ( string s, int a, int b) => s.Substring...
Posted by bart | 6 comment(s)
By now, most – if not all – readers of my blog will be familiar with this C# 3.0 and VB 9.0 feature called Local Variable Type Inference or Implicitly Typed Local Variables. The idea is simple: since the compiler knows (and hence can infer) type information...
Posted by bart | 23 comment(s)
Filed under: ,
Everyone knows array initializers; they’ve been part of the language since the very beginning. But do you know how this innocent looking construct really works? var ints = new [] { 1, 2, 3 }; Before we continue, I should point out that the above sample...
Posted by bart | 10 comment(s)
Filed under: ,
More Posts « Previous page - Next page »