F# - Keep F# interactive from posting output

佐手、 提交于 2019-11-27 18:00:14

问题


I'm working with F# interactive and I'm computing some large lists and arrays and I'd rather not have the interactive window post all of that information. Is there way to suppress output?

Specifically I'm developing single threaded and multithreaded algorithms and evaluating at what point does it become more efficient to change from a single threaded function to a multithreaded one. I'd like to have F# Interactive report the run time for the functions, I've been using #time, but I don't want to have to scroll way back up when it prints the large matrix of data to the screen. If there is a way to just get the timing data while keeping the interactive environment from writing out the matrix I would be very appreciative.


回答1:


I ended up using

fsi.ShowDeclarationValues <- false

Which kept it from outputting all of the data. Thank you for the tips though.




回答2:


Check out

http://blogs.msdn.com/b/dsyme/archive/2010/01/08/some-tips-and-tricks-for-formatting-data-in-f-interactive-and-a-in-sprintf-printf-fprintf.aspx

for some suggestions that may be relevant.



来源:https://stackoverflow.com/questions/2971685/f-keep-f-interactive-from-posting-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!