How to execute F# code found in a string in a compiled F# program?

后端 未结 3 735
不思量自难忘°
不思量自难忘° 2020-12-14 10:39

How do I execute F# code from a string in a compiled F# program?

3条回答
  •  眼角桃花
    2020-12-14 11:21

    Are you looking for an Eval function?

    You might want to try looking at this blog post:

    http://fsharpnews.blogspot.com/2007/02/symbolic-manipulation.html

    If you read in your expressions into these kind of symbolic datastructures, they are pretty easy to evaluate.


    Or, perhaps you are looking for scripting support:

    http://blogs.msdn.com/chrsmith/archive/2008/09/12/scripting-in-f.aspx


    If you really want dynamic compilation, you could do it with the F# CodeDom provider.

提交回复
热议问题