extending 'import' using 'with'

rumbu via Digitalmars-d digitalmars-d at puremagic.com
Thu Apr 2 12:13:29 PDT 2015


On Wednesday, 1 April 2015 at 19:04:43 UTC, ketmar wrote:
> On Wed, 01 Apr 2015 16:16:58 +0000, Paulo Pinto wrote:
>
>> Actually metaprogramming is how a lot of magic happens in Java 
>> and .NET.
>
> without on-the-fly code generation that's a mockery.

Metaprogramming in .net is done through T4 templates. This is a 
Visual Studio feature, not a language feature.

There are two types of T4 templates:
- text templates - similar to mixins in D, you create a .tt file 
and each time you save it, a counterpart source file (even a .d 
source file) is created;
- runtime text templates - code is generated and compiled at 
runtime on the fly.

That's how most of the Visual Studio code designers and 
generators work.

Template language can be C# or VB and T4 templates support 
debugging.






More information about the Digitalmars-d mailing list