Being partial to the full-REPL-reboot style of development (ala DrRacket) for most situations I wanted the same thing in Emacs with sml-mode. The value add is that you know all of your files are saved and that your environment is in a fresh and known state. I came up with this:
(defun gcr/sml-eval-buffer ()
"Intelligently evaluate a SML buffer."
(let ((sml-process (get-process "sml")))
(let ((sml-buffer (get-buffer "*sml*")))
(sml-prog-proc-load-file buffer-file-name t))
Only to be delighted (though not surprised) to find yet another nearly identical approach here by wenjun.yan:
(defun isml ()
"If sml repl exists, then restart it else create a new repl"
(when (get-buffer "*sml*")
(when (process-live-p "sml")
(sml-run "sml" ""))
My urge to attain Emacs Comint mastery only grows.
“To Be Or Not To Be Standard ML”… here.
Never knowing what is the right time for a path to present itself, I think I am back on the path to SML again. This time I got some more feedback and wanted to capture it here.
We’ll see what is my cup of tea.
David recently pulled in a couple of changes to make OB-SML happy with Emacs’ package manager, SML-MODE 6.4, and Org Babel. For you reproducible research junkies, this is super-cool. It is already out on Marmalade.
I’m going to work through
SLOWLY over MANY MONTHS.
The reason is that I’ve never learned a statically typed functional programming language, I feel weak on recursive data type definitions, and I am curious about compiler and interpreter construction. So, I’m looking for a way to learn about all 3 at once.
- Proven, excellent pedagogical language with great resources.
- Smaller than OCaml, F#, and Haskell; so I won’t get distracted with tons of “stuff”
- Puts me in a good position if I wanted to use it “for real” that OCaml, F#, Haskell, or even Scala and some other ML in Java languages would be a good follow up path in terms of leveraging the investment.
Basically when I sit down to learn the basics of anything from #2 I feel like they assume you know the basics of ML, and well, I don’t!
Let me know if you want to review problems together.