mixguile without arguments will enter the Guile REPL
(read-eval-print loop) after loading, if it exists, the user’s
initialisation file (~/.mdk/mixguile.scm).
mixguile accepts the same command line options than Guile:
mixguile [-s SCRIPT] [-c EXPR] [-l FILE] [-e FUNCTION] [-qhv] [--help] [--version]
The meaning of these options is as follows:
Prints usage summary and exits.
Prints version and copyleft information and exits.
Loads Scheme code from script, evaluates it and exits. This option can be used to write executable Scheme scripts, as described in Scheme scripts.
Evaluates the given Scheme expression and exits.
Loads the given Scheme file and enters the REPL (read-eval-print loop).
After reading the script, executes the given function using the provided command line arguments. For instance, you can write the following Scheme script:
#! /usr/bin/mixguile \ -e main -s !# ;;; execute a given program and print the registers. (define main (lambda (args) ;; load the file provided as a command line argument (mix-load (cadr args)) ;; execute it (mix-run) ;; print the contents of registers (mix-pall)))
save it in a file called, say, foo, make it executable, and run it as
$ ./foo hello
This invocation will cause the evaluation of the
with a list of command line parameters as its argument (
"hello") in the above example. Note that command line options to
mixguile must be written in their own line after the
Do not load user’s initialisation file. When
mixguile starts up,
it looks for a file named mixguile.scm in the user’s MDK
configuration directory (~/.mdk), and loads it if it exists. This
mixguile to skip this initialisation file loading.