This is a quick introduction to F# and Visual Studio 2008. Download and install the latest version of F# [September 2008 CTP as of this post]. Fire up VS2008 and get started!
The first thing to note is that F# will not like it when you use the default 'tab' settings that comes with VS. So go to Tools -> Text Editor -> F# and expand that submenu. Select Tabs and change it to the values shown in the image.
Next, go to File -> New -> Project and pull up the New Project dialog. Select the Visual F# option in the left pane and notice the types of projects available to you:
- F# Application
- F# Library
- F# Tutorial
Now you can start writing code and executing it by:
[1] Highlighting the code, and hitting Alt + Enter will send your highlighted code to the FSI for execution. The results are then displayed in the FSI window.
[2] Typing your code directly in the FSI window. When you are done typing in the FSI and you are ready to run the code, add two semi-colons (;;) at the end of your code and hit Enter to execute.
[1] Highlighting the code, and hitting Alt + Enter will send your highlighted code to the FSI for execution. The results are then displayed in the FSI window.
[2] Typing your code directly in the FSI window. When you are done typing in the FSI and you are ready to run the code, add two semi-colons (;;) at the end of your code and hit Enter to execute.
No comments:
Post a Comment