Advertisement
konalisp

C# using F# DLL

Aug 8th, 2014
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. //-----C# (Main File):
  2.  
  3. using System;
  4. using fstest;
  5.  
  6. //Main
  7. class Entry
  8. {
  9.     static int Main( string[] args )
  10.     {
  11.         Console.WriteLine(testfun.addtwo(2, 6));
  12.         return 0;
  13.     }
  14. }
  15.  
  16. //-----F# (libtest.fs) (compiles to DLL):
  17.  
  18. namespace fstest
  19.  
  20. module testfun =
  21.  
  22. let addtwo x y = x + y
  23.  
  24. //-----compile.bat:
  25.  
  26. fsc.exe libtest.fs --standalone --target:library
  27. csc.exe *.cs /r:libtest.dll
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement