Basically what I would like to know is if there is any way to add new 'statements' to the .net based languages?
An example of what I'm looking for would be something like introducing a public class MyClass decoratorOf ClassWithLotsOfMethods
and in pre-compile time changing that to be a normal class that overrides everything by default but the methods I define.
Another example would be the .net 3.5 auto properties, or extension methods, etc
This is just for fun, not that I really want to do this, just curious if is possible
Thanks! Seba
C# doesn't allow this. You can of course tweak the generated IL with a post-compiler (like CciSharp).
Some alternative .NET languages that allow extensions are Nemerle and Boo.
There is nothing built-in.
You could of course use a PreProcessor but that won't make you popular.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With