Open dpkatz opened 10 years ago
I just opened a pull request that fixes part of this issue -- the leading dashes. You can fix the other ("stdIn") by simply removing the semicolon from your source blocks. It's caused by some quirks of the way Babel and SML/NJ interact and how the output of SML/NJ is cleaned up before turning into the results block.
I think you should almost never need to add a semicolon to the end of a source block, unless something changes with the interactive prompt for SML/NJ. For instance:
#+BEGIN_SRC sml
datatype 'a option = Some of 'a | None
datatype ('a, 'b) either = Left of 'a | Right of 'b
#+END_SRC
ob-sml.el will add a single semi colon to the end of this before sending it to SML/NJ, which is all you need. I think this is preferred since it will be exported (or tangled) to produce the same code you would write in a regular source file, i.e. with semicolons only where absolutely necessary (imperative code).
Extra whitespace in source blocks seems to matter to ob-sml in unexpected ways (at least when interacting with smlnj). Here's an org file that shows the issue: