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:
Loads Scheme code from script, evaluates it and exits. This option can be used to write executable Scheme scripts, as described in Scheme scripts.
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
mainfunction with a list of command line parameters as its argument (
("./foo" "hello")in the above example. Note that command line options to mixguile must be written in their own line after the