-[clisp]
-
-;; CLisp causes much sadness. Superficially, it's the most sensible of all
-;; of the systems supported here: you just run `clisp SCRIPT -- ARGS ...' and
-;; it works.
-;;
-;; The problems come when you want to do some preparatory work (e.g., load
-;; `asdf') and then run the script. There's a `-x' option to evaluate some
-;; Lisp code, but it has three major deficiencies.
-;;
-;; * It insists on printing the values of the forms it evaluates. It
-;; prints a blank line even if the form goes out of its way to produce no
-;; values at all. So the whole thing has to be a single top-level form
-;; which quits the Lisp rather than returning.
-;;
-;; * For some idiotic reason, you can have /either/ `-x' forms /or/ a
-;; script, but not both. So we have to include the `load' here
-;; explicitly. I suppose that was inevitable because we have to inhibit
-;; printing of the result forms, but it's still a separate source of
-;; annoyance.
-;;
-;; * The icing on the cake: the `-x' forms are collectively concatenated --
-;; without spaces! -- and used to build a string stream, which is then
-;; assigned over the top of `*standard-input*', making the original stdin
-;; somewhat fiddly to track down.
-;;
-;; There's a `-i' option which will load a file without any of this
-;; stupidity, but nothing analogous for immediate expressions.
-
-clisp-common-startup =
- (setf *standard-input* (ext:make-stream :input))
- (load "${@SCRIPT|q}" :verbose nil :print nil)
- (ext:quit)
-
-command = ${@ENV:CLISP?clisp}
-image-file = clisp+asdf.mem
-
-run-script =
- ${command}
- $?@IMAGE{-M "${image-path}" -q
- -x "(progn
- ${image-restore}
- ${clisp-common-startup})" |
- -norc -q
- -x "(progn
- ${run-script-prelude}
- ${clisp-common-startup})"}
- --
-
-dump-image =
- ${command} -norc -q -q
- -x "${dump-image-prelude}"
- -x "(ext:saveinitmem \"${@IMAGE|q}\" :norc t :script t)"
-
-;;;--------------------------------------------------------------------------
-[ecl]
-
-command = ${@ENV:ECL?ecl}
-image-file = ecl+asdf
-
-run-script =
- $?@IMAGE{"${image-path}" -s ${@SCRIPT} |
- ${@ENV:ECL?ecl} "${@ECLOPT}norc"
- "${@ECLOPT}eval" "(progn
- ${run-script-prelude}
- ${clear-cl-user})"
- "${@ECLOPT}shell" ${@SCRIPT}}
- --
-
-dump-image =
- "${@CONFIG:data-dir}/dump-ecl"
- "${@IMAGE}" "${command}" "${@ECLOPT}" "${@TMPDIR}"
-
-;;;--------------------------------------------------------------------------
-[cmucl]
-
-command = ${@ENV:CMUCL?cmucl}
-image-file = cmucl+asdf.core
-
-run-script =
- ${command}
- $?@IMAGE{-core "${image-path}" -eval "${image-restore}" |
- -batch -noinit -nositeinit -quiet
- -eval "(progn
- (setf ext:*require-verbose* nil)
- ${run-script-prelude})"}
- -load ${@SCRIPT} -eval "(ext:quit)" --
-
-dump-image =
- ${command} -batch -noinit -nositeinit -quiet
- -eval "${dump-image-prelude}"
- -eval "(ext:save-lisp \"${@IMAGE|q}\"
- :batch-mode t :print-herald nil
- :site-init nil :load-init-file nil)"
-
-;;;--------------------------------------------------------------------------
-[abcl]
-
-;; CLisp made a worthy effort, but ABCL still manages to take the prize.
-;;
-;; * ABCL manages to avoid touching the `stderr' stream at all, ever. Its
-;; startup machinery finds `stdout' (as `java.lang.System.out'), wraps it
-;; up in a Lisp stream, and uses the result as `*standard-output*' and
-;; `*error-output*' (and a goodly number of other things too). So we
-;; must manufacture a working `stderr' the hard way.
-;;
-;; * There doesn't appear to be any easy way to prevent toplevel errors
-;; from invoking the interactive debugger. For extra fun, the debugger
-;; reads from `stdin' by default, so an input file which somehow manages
-;; to break the script can then take over its brain by providing Lisp
-;; forms for the debugger to evaluate.
-;;
-;; * And, just to really top everything off, ABCL's `adjoin.lisp' is
-;; missing an `(in-package ...)' form at the top, so it leaks symbols
-;; into the `COMMON-LISP-USER' package.
-
-command = ${@ENV:ABCL?abcl}
-
-abcl-startup =
- (let ((#9=#:script "${@SCRIPT|q}"))
- ${run-script-prelude}
- ${clear-cl-user}
- (setf *error-output*
- (java:jnew "org.armedbear.lisp.Stream"
- \'sys::system-stream
- (java:jfield "java.lang.System" "err")
- \'character
- java:+true+))
- (handler-case (load #9# :verbose nil :print nil)
- (error (error)
- (format *error-output* "~A (unhandled error): ~A~%" #9# error)
- (ext:quit :status 255))))
-
-run-script =
- ${command} --batch --noinform --noinit --nosystem
- --eval "${abcl-startup}"
- --
-
-;;;----- That's all, folks --------------------------------------------------