summaryrefslogtreecommitdiff
path: root/com/allegro/savesys
blob: 3d3abd88ae0e61a528421c1389edf5a3aa6831be (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/csh
#
# savesys -- build a saved executable in bin/new-allegro-haskell
#
#
cd $Y2
setenv PRELUDEBIN $Y2/progs/prelude/$ALLEGRODIR
if !(-e $PRELUDEBIN/Prelude.fasl) then
  echo "Build the prelude first, stupid..."
  exit
  endif
$ALLEGRO <<EOF
;;; Load the Haskell system.
#+next (progn (load "com/allegro/next-patches/patch0149.fasl")
              (load "com/allegro/next-patches/patch0151.fasl"))
#+sparc (load "com/allegro/sparc-patches/patch0151.fasl")
(make-package "MUMBLE-IMPLEMENTATION" :use '("LISP"))
(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)
(setf excl:*load-source-file-info* nil)
(setf excl:*record-source-file-info* nil)
(setf excl:*load-xref-info* nil)
(setf excl:*record-source-file-info* 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))
(excl:dumplisp
  :name #+next "bin/new-allegro-next-haskell" #-next "bin/new-allegro-haskell"
  :restart-function 'haskell-toplevel)
(excl:exit)
EOF