Hi,
I think the most common scenario for using F# scripts is to experiment with some idea using the F# interactive window in the Visual Studio. I often open F# file just to try something or to write some short code snippet. Once I try it, I paste it to a larger project or create a new project to do the thing more seriously. The nice thing about scripts is that you can just create one without even saving it, write some code and run it using F# interactive.

BTW: To run a code inside FSI, you can just select it in Visual Studio and hit Alt + Enter. This means that when using scripts, you don't really need to compile the code you're writing - just paste it to the F# interactive.

Another common scenario is that you have some library written in F# and create a script to test it. Then you'd add #r directive to load the library and you can test it interactively.

T.

By on 11/10/2008 11:26 AM ()

Right -- scriptipng in F# Interactive was always there. Yet I found that with CTP a new type of file, F# Script, had come to be, with .fsx extension. Is its only purpose in life to be loaded into the toplevel? That could be done with any old source files .fs, right? I read that you don't have to compile/build a project to run a script -- how's that, by just loading into toplevel? What exactly is new with F# scripts?

By on 11/13/2008 9:55 PM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper