1

I want to write a MyGeneration Template File in F#. I know you can target various languages etc VB.NET and C# however for my own selfish benefit I would like to write it in F#.

Anyone one if and how this is possible?

Jonathan
  • 2,318
  • 7
  • 25
  • 44
  • 1
    you mean F# as GUI_LANGUAGE, or OUTPUT_LANGUAGE? – Mauricio Scheffer May 12 '10 at 18:56
  • 1
    not really an answer but maybe you could try hacking together some example template file in C# and some of us might be able to help you to translate it to F# and then you could try it to see if it works. – Onorio Catenacci May 13 '10 at 01:44
  • Im looking to use F# as the Input language and then generate C# code ... well now that I think about it. Perhaps I should be generating F# code. Im not fully up to speed with F# and wanted to use it as an opertunity to get stuck in. – Jonathan May 13 '10 at 09:01

2 Answers2

1

I'm not sure writing a template in F# would be the best move. Although it could be done by referencing a Class Library (At least in CodeSmith). This way you could move all of your F# logic and processing code into a Visual Studio Class Library and still use it inside of the template.

Thanks -Blake Niemyjski (Author of the CodeSmith CSLA Templates)

Blake Niemyjski
  • 3,432
  • 3
  • 25
  • 41
1

In visual studio you can use T4 templating to generate any type of output using a psudo "asp classic" style syntax, where you intermix your code (F#) and the "output."

Heres a good place to get started: http://www.hanselman.com/blog/T4TextTemplateTransformationToolkitCodeGenerationBestKeptVisualStudioSecret.aspx

Nate
  • 30,286
  • 23
  • 113
  • 184