I’ve created a little sample on how to make your own .NET compiler. The compiler uses Gold parser for parsing and Reflection.Emit to generate the compiled .exe file. Initially I intended to make a sample on how to use Gold parser to parse and then compile Linq expressions, thus the name GoldLinq, however, Linq have now been replaced…More
Category Archives: .NET
Linq Expressions – Creating objects
This post shows how you can use Linq expression trees to replace Activator.CreateInstance. but first, please note that this is a followup on Oren’s post so read it before you read mine: http://www.ayende.com/Blog/archive/2008/02/27/Creating-objects–Perf-implications.aspx In C#3 we can use Linq expression trees to solve this problem to. I’m not saying that it is a better or faster…More
Linq Expressions – Calculating with generics
You can find the full code for this post here: http://www.puzzleframework.com/Roger/GenericMath.cs.txt The .NET framework lacks support for calculating with generic types. There is no way to ensure that a generic type supports operations like Add, Sub, Div and Mul etc. More about the problem can be found here: http://www.thescripts.com/forum/thread278230.html “They are not. There have been…More
Linq Expressions – Access private fields
In this post I will show how you can use Linq Expressions to access private(or public) class fields instead of using Reflection.FieldInfo. Normally when you want to access a field by its name on a type you have to resort to reflection. You will end up with something like this: FieldInfo field = MyType.GetField(“someField”,BindingFlags.NonPublic | ….…More
Linq to NPersist to MS Access
I’ve finally seen my own Linq support Live :-P Untill now I’ve only been emitting NPath quereis and verified that NPath is correct. The reason I havent tested it live untill now is that I only have my gaming machine to develop on atm. the dev machine is dead. Anyway, I’m trying it against NWind…More
