/libs/FSharp-2.0.0.0/doc/README-vfsi.html

https://github.com/pblasucci/Giftee · HTML · 89 lines · 58 code · 31 blank · 0 comment · 0 complexity · ddcb9352f5ceb056663b9b8c71197b82 MD5 · raw file

  1. <html>
  2. <head>
  3. <title>The F# Compiler Version 2.0.0.0</title>
  4. <link type="text/css" rel="Stylesheet" href="/rmcstyle.css"><link type="text/css" rel="Stylesheet" href="rmcstyle-copy.css">
  5. <link type="text/css" rel="Stylesheet" href="/groupStyle.css"><link type="text/css" rel="Stylesheet" href="groupStyle-copy.css">
  6. <style type="text/css">
  7. TT { font-weight: bold; color: blue; font-size: 10pt; }
  8. PRE { font-weight: bold; color: blue; font-size: 10pt; }
  9. </style>
  10. </head>
  11. <body>
  12. <h1> Using F# Interactive in Visual Studio</h1>
  13. <p>
  14. If you use Visual Studio 2008 or Visual Studio 2010 (including the
  15. freely available <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=40646580-97FA-4698-B65F-620D4B4B1ED7&displaylang=en">Visual Studio 2008 Shell</a> and
  16. the <a href="http://www.microsoft.com/downloads/en/details.aspx?familyid=8E5AA7B6-8436-43F0-B778-00C3BCA733D3&displaylang=en">Visual Studio 2010 Integrated Shell</a>),
  17. you can use 'F# Interactive' as a tool window! </p>
  18. <h4>Starting F# Interactive</h4>
  19. <p> To start the session, go to the View -> Other Windows and select 'F# Interactive'. You can also start a session
  20. simply using <tt>Alt-Return</tt> in an F# source document, or using the shortcut Ctrl+Alt+F.</p>
  21. <h4>Editing and Evaluating a Script</h4>
  22. <p>You create a script file using File -> New File -> Script -> F# Script File.</p>
  23. <p> The normal mode of operation is to edit an F# script file and send fragments for execution in the tool window. In
  24. this mode, your fragments are typechecked as you type, and you are actively working towards a completed
  25. file that can act as the finished product of your explorative programming. The tool window is then
  26. just used for displaying data.</p>
  27. <p>In the script file, you should use <tt>#r</tt> and <tt>#I</tt> to reference assemblies
  28. and augment your assembly include path.</p>
  29. <p>The session is global to the instance of Visual Studio and text can be sent from any
  30. F# source code file (.fs, .fsi, .fsx, .ml, .mli).
  31. Use the <tt>Alt-Return</tt> combination to evaluate
  32. selected text. For example, highlight <tt>printfn "Hello World"</tt> and use this key combination - the code will then
  33. execute. </p>
  34. <h4>Execution Context for Scripts</h4>
  35. <p>The F# Interactive session executes only those code fragments you direct it to. If you select a fragment from
  36. half-way through your script, earlier portions of the script will not be executed implicitly. </p>
  37. <p>When sending text from a file, file names are resolved relative to the scripts containing the reference. Visual F# Interactive sets the
  38. line and directory context of the session each time an entry is sent from Visual Studio, though it doesn't
  39. adjust the value of <tt>System.Environment.CurrentDirectory</tt>. It can be useful to add </p>
  40. <pre>
  41. System.Environment.CurrentDirectory <- __SOURCE_DIRECTORY__
  42. </pre>
  43. <p>to your script. <tt>__SOURCE_DIRECTORY</tt> can be used in any F# source file and is expanded to the directory
  44. containing the file.</p>
  45. <h4>Organizing Your Scripts</h4>
  46. <p> Although scripts can be authored without a project, it can be useful to create an F# Project to hold a group of related scripts.
  47. You can do this with <tt>New Project</tt> or by making a copy of one of the projects in
  48. the F# Samples directory. You can also use <tt>#load</tt> to load both signature and implementation files as
  49. if they have been compiled as compilation units by the command-line compiler.</p>
  50. <h4>Controlling the Evaluation Session</h4>
  51. <p>In the tool window, <tt>#quit;;</tt> will quit and Ctrl+C will cancel execution.
  52. The context menu in the tool window includes
  53. "Reset Session" and "Cancel Evaluation" commands.
  54. If you do type into the tool window, history is available with the up/down arrows. </p>
  55. <p> To troubleshoot, see README-fsharp.html</p>
  56. <p>Please contact fsbugs@microsoft.com with feedback on this documentation.</p>
  57. </body>
  58. </html>