开发者

F# interactive session persistance and other such user questions

Is there any way of persisting my F# session or serializing it into a file? i.e. so I can hand it to a friend and say "run this" and they will be at the same place I was? I know forth had this ability but I can't find any way of doing this.

An alternative would be a log file or something of similar ilk, but ideally it开发者_高级运维 would strip the output and just give me the code I wrote.

On the topic of user questions, is there a config file for F# so I can add some "always includes" or alter the defaults?


There is no way to serialize the F# Interactive session or create some log of commands automatically.

The typical user interaction is that you write all your code in F# Script File (.fsx extension) and evaluate code by selecting lines and sending them to F# Interactive using Alt+Enter. If you work like this, then the F# Script File is a bit like log of your work - and you can easily send it to other people.

The good thing about this approach is that you can edit the file - if you write something wrong, you can correct it and the wrong version will not appear in the log. The bad thing is that you need some additional effort to keep the source file correct.

Regarding automatic inclusions - you can specify options for fsi.exe in Visual Studio Options (F# Tools). The --load command line parameter can be used to load some F# source at startup.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜