You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The documentation for embedding F# interactive suggests you set up the session like this:
let argv = [| "C:\\fsi.exe" |]
let allArgs = Array.append argv [|"--noninteractive"|]
let fsiConfig = FsiEvaluationSession.GetDefaultConfiguration()
let fsiSession = FsiEvaluationSession.Create(fsiConfig, allArgs, inStream, outStream, errStream)
Some questions:
the path to fsi.exe is ignored, indeed the path argument can seemingly be omitted altogether and I found a post on StackOverflow from someone saying the same thing. However looking through the code I found the line
so does that mean that if you do not include a dummy fsi.exe argument then the List.tail call will throw away the first of your real arguments? Is the purpose of the first argument soley as a sacrificial victim for the call to List.tail?
Looking in the code the "--noninteractive" flag gets mapped to a property that determines whether a background thread is started to watch console input and/or stdin. Is the idea that people might make their own fsi based console? Naively it seems like noninteractive should be the default, because I would have thought most users of F# compiler services do not want to start a background thread watching stdin when evaluating scripts in their host application?
The text was updated successfully, but these errors were encountered:
I'm not sure if it is possible to change it now without breaking backwards compatibility. However it is rather confusing, and it may be that people omit this first parameter and then inadvertantly their first real argument will be ignored.
I could create a PR which just sets the default of interactive mode to false? Or maybe it would now be better to just leave things as they are now. And if it is changed then there might need to be a new flag to enable the background thread in case someone does want it.
The documentation for embedding F# interactive suggests you set up the session like this:
Some questions:
so does that mean that if you do not include a dummy fsi.exe argument then the List.tail call will throw away the first of your real arguments? Is the purpose of the first argument soley as a sacrificial victim for the call to List.tail?
The text was updated successfully, but these errors were encountered: