fsprojects / IfSharp

F# for Jupyter Notebooks
Other
441 stars 71 forks source link

Display Standard Out #127

Closed sylvanc closed 7 years ago

sylvanc commented 7 years ago

Attach a string builder as System.Console.Out and send its contents to the notebook on Display and when execution completes.

Do not send a "pyout" message when the result of a cell is of type unit, in order to avoid printing "".

cgravill commented 7 years ago

Looks good on the null reduction.

Could this be extended to handle #125 without directive workarounds? Trying this pull request we're still outputting in the <fun:addTwo@1> form rather than the way functions get printed on fsi.

sylvanc commented 7 years ago

@cgravill Not currently, as we are doing sprintf "%A" for anything that doesn't have a custom display printer. We would have to check for a function type and print the identity as well as the type.

Unless you have some other approach?

cgravill commented 7 years ago

Nothing specific, just that since you're capturing the fsi print output I hoped we could the form with more user friendly printing of functions.