Justinfront (1) [Avatar] Offline
#1
Hi, I just bought the Functional Programming book earlier today ( well yesterday ) because I was interested in making better use of HaXe's functional aspects, and there were no books on Ocaml ( the language haXe compiler is written on ).

Anyway I am on a mac so I am trying to setup F# on a mac.

I am not really too sure how to compile on a mac. I have managed to get Mono installed and fsi.exe seems to work.

Now I wanted to compile from 'Textmate'. I downloaded the textmate bundle which seemed to have highlighting but the eval script did not work and seemed complex involving iterm rather just terminal, so based on haxe2's "build selected' I added a command that allows textmate to compile f# from the terminal.


# Compiles from a selected .fs file
echo compile: "$TM_FILEPATH"
echo

cd "$TM_PROJECT_DIRECTORY"

mono /usr/lib/fsharp/bin/fsc.exe "$TM_FILEPATH"



But I found an example file online which looked like a good test of if I have a proper setup...

http://laurent.le-brun.eu/site/index.php/2010/06/23/57-fsharp-opengl-a-cross-platform-sample


It uses OpenTK, which I have downloaded, but the fsc compiler keeps complaining about not understanding OpenTK, I have tried -r OpenTK.dll but am really in the dark as how to set up the compiler.

Could someone explain a bit more about how I might use fsc for compiling f# ( on mac ) and obviously to a level that I can also run the book examples and also ones using OpenTK, I would be really grateful, (if this is in the book somewhere page no?).


Many Thanks.