scm: clean up scm running

Split run_script / run_repl more clearly; update callers.
This commit is contained in:
Dirk-Jan C. Binnema
2025-08-25 08:31:12 +03:00
committed by Seth Ladygo
parent 5378f321f4
commit 013233c041
4 changed files with 84 additions and 80 deletions

View File

@ -40,23 +40,36 @@
*/
namespace Mu::Scm {
/**
* Start a guile REPL or program
* Start a Guile/SCM REPL
*
* Initialize the Scm sub-system, then start a REPL or run a script,
* based on the configuration.
*
* Unless 'blocking' is false or there is some pre-guile error, this
* method never returns. If blocking is false, it runs in the
* background.
* Initialize the Scm sub-system, then start a REPL, based on the
* configuration.
*
* @param store a Store object
* @param opts options
* @param blocking whether to block (or run in the background)
* @param opts options; opts.scm.script_path must be Nothing
* @param socket_path if non-empty, run in the background on the
* socket path (Unix domain socket); otherwise, run an
* interactive shell in blocking mode.
*
* @return Ok() or some error
*/
Result<void> run(const Store& store, const Options& opts,
bool blocking=true);
Result<void> run_repl(const Store& store, const Options& opts,
const std::string& socket_path = {});
/**
* Run a Guile/SCM script
*
* Initialize the Scm sub-system, then start run a script,
* based on the configuration.
*
* @param store a Store object
* @param opts options; opts.scm.script_path must set
*
* @return Ok() or some error
*/
Result<void> run_script(const Store& store, const Options& opts,
const std::string& script_path);
/**
* Helpers