zz - Start F# interactively in Visual studio

本文介绍了如何使用F#Interactive(fsi.exe)在控制台或Visual Studio中运行F#代码,执行读取、评估、打印循环,并提供了从命令行启动、通过Visual Studio运行以及在不同场景下使用的详细步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The original site of the discussion is available here:  http://msdn.microsoft.com/en-us/library/dd233175.aspx 

F# Interactive (fsi.exe) is used to run F# code interactively at the console, or to execute F# scripts. In other words, F# interactive executes a REPL (Read, Evaluate, Print Loop) for the F# language.

F# Interactive can be used to write code at the console or in a window in Visual Studio.

To run F# Interactive from the console, run fsi.exe. For information about command line options available, see F# Interactive Options.

To run F# Interactive through Visual Studio 2010, you can click the appropriate toolbar button labeled F# Interactive, or use the keys Ctrl+Alt+F. Doing this will open the interactive window, a tool window running an F# Interactive session. You can also select some code that you want to run in the interactive window and hit the key combination ALT+ENTER. F# Interactive starts in a tool window labeled F# Interactive. When you use this key combination, make sure that the editor window has the focus.

Whether you are using the console or Visual Studio 2010, a command prompt appears and the interpreter awaits your input. You can enter code just as you would in a code file. To compile and execute the code, enter two semicolons (;;) to terminate a line or several lines of input.

F# Interactive attempts to compile the code and, if successful, it executes the code and prints the signature of the types and values that it compiled. If errors occur, the interpreter prints the error messages.

Code entered in the same session has access to any constructs entered previously, so you can build up programs. An extensive buffer in the tool window allows you to copy the code into a file if needed.

When run in Visual Studio, F# Interactive runs independently of your project, so, for example, you cannot use constructs defined in your project in F# Interactive unless you copy the code for the function into the interactive window.

You can control the F# Interactive command line arguments (options) by adjusting the settings. On the Tools menu, select Options..., and then expand F# Tools. The two settings that you can change are the F# Interactive options and the 64-bit F# Interactive setting, which is relevant only if you are running F# Interactive on a 64-bit machine. This setting determines whether you want to run the dedicated 64-bit version of fsi.exe or fsianycpu.exe, which uses the machine architecture to determine whether to run as a 32-bit or 64-bit process.

...



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值