The first error on F#

Copy the first demo program from Expert F# to VS2008. There has a compiler error with split function when I compiler the program. I found a solution from internet likes below:

Code

Thanks the guy shared this on his blog.

Another way to run the demo program is on command line.
1. Open a command line window
2. Go to the FSharp installed path
3. Type the fsi.exe (it is the F# interactive environment)
4. Type #help;; command, it will show the help of F# interactive environment.
5. Copy the demo program and paste it to command line window, notice: should type the ;; at the end.
If you press the enter key, you will get a compiler error about the split function. Now, we know the DLL file missed. We can use the
#r "FSharp.PowerPack.dll";;
command to  set reference dll file.
6. Paste the program again, then you will get the
val wordCount : string -> int * int
val showWordCount : string -> unit
If you get the message, it means your first F# program works well now.

posted @ 2009-08-26 23:30  moonz-wu  阅读(324)  评论(0编辑  收藏  举报