diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2016-12-24 08:33:36 +0100 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2016-12-24 08:33:36 +0100 |
commit | b71a63c28f11328e3bbfd59d2736750c737f98bb (patch) | |
tree | 6e1d807567145191079fe868f937ae156a99dfb6 | |
parent | de4f005c76d28b0120c37b3e800ea79c9ff503a1 (diff) |
Add build scripts for CLISP.
-rwxr-xr-x | build-clisp-haskell.bash | 12 | ||||
-rw-r--r-- | com/clisp/savesys.lisp | 40 |
2 files changed, 52 insertions, 0 deletions
diff --git a/build-clisp-haskell.bash b/build-clisp-haskell.bash new file mode 100755 index 0000000..d6fc502 --- /dev/null +++ b/build-clisp-haskell.bash @@ -0,0 +1,12 @@ +#!/bin/bash + +dirs="ast backend cfn cl-support com command-interface csys depend derived flic import-export parser prec + printers progs/prelude runtime support tdecl top type util" + +for dir in ${dirs}; do + mkdir -p $dir/clisp +done + +export Y2=$PWD + +clisp com/clisp/savesys.lisp diff --git a/com/clisp/savesys.lisp b/com/clisp/savesys.lisp new file mode 100644 index 0000000..7010b03 --- /dev/null +++ b/com/clisp/savesys.lisp @@ -0,0 +1,40 @@ +(make-package "MUMBLE-IMPLEMENTATION") +(load "cl-support/cl-init") + +;;; Set various internal switches to appropriate values for running +;;; Haskell code. +(proclaim '(optimize (speed 3) (safety 0) (compilation-speed 0))) +(setf *compile-verbose* nil) +(setf *load-verbose* nil) +(in-package :mumble-user) +(setf *printers* '(compiling loading)) +(setf *optimizers* '()) +(setf *compile-interface* '#f) + +;;; Load the prelude. +(compile/load *prelude-unit-filename*) + +;;; Set up the saved system. +(define *saved-readtable* (lisp:copy-readtable lisp:*readtable*)) + +(define (haskell-toplevel) + ;; Saved system always starts up in USER package. + (setf lisp:*package* (lisp:find-package :mumble-user)) + ;; Saved system seems to forget about our readtable hacks. + (setf lisp:*readtable* *saved-readtable*) + ;; Set printer variables w/implementation-defined initial values + ;; to known values + (setf *print-pretty* '#f) + (load-init-files) + (do () ('#f) + (cl:with-simple-restart (restart-haskell "Restart Haskell.") + (heval)))) + +(define (restart-haskell) + (cl:invoke-restart 'restart-haskell)) + +(ext:saveinitmem "bin/clisp-haskell" + :executable t + :quiet t + :init-function 'haskell-toplevel) +(ext:exit) |