Created
April 21, 2013 10:48
-
-
Save 7sharp9/5429227 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module compilertesting.Main | |
open System | |
open System.IO | |
open System.Text | |
open Microsoft.FSharp.Compiler.SimpleSourceCodeServices | |
[<EntryPoint>] | |
let main args = | |
let fileName = "/Users/dave/code/compilertesting/compilertesting/test.fs" | |
let sscs = SimpleSourceCodeServices() | |
let sb1 = StringBuilder() | |
let sb2 = StringBuilder() | |
let t1 = new StringWriter(sb1) :> TextWriter | |
let t2 = new StringWriter(sb2) :> TextWriter | |
try | |
let error, i, ass = | |
sscs.CompileToDynamicAssembly([|"--noframework" | |
"--nologo" | |
"--target:library" | |
"--out:/Users/dave/code/compilertesting/thelib/bin/Debug/test.dll" | |
"--noframework" | |
"--define:DEBUG" | |
"--debug+" | |
"--optimize-" | |
"--tailcalls-" | |
"-r:/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/4.0/FSharp.Core.dll" | |
"-r:/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.0/mscorlib.dll" | |
"-r:/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.0/System.dll" | |
"-r:/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.0/System.Core.dll" | |
"-r:/Library/Frameworks/Mono.framework/Versions/3.0.10/lib/mono/4.0/System.Numerics.dll" | |
"/Users/dave/code/compilertesting/compilertesting/test.fs"|], Some(t1, t2) ) | |
() | |
with | |
| ex -> | |
printfn "%s" ex.Message | |
Console.ReadLine() |> ignore | |
0 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module test | |
open System | |
let reverse str = | |
str |> Array.Reverse |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment