reduce/apply/values corrections
[CommonLispStat.git] / defsys.lsp
blob37b536ac46afe51f1946a716abd56a854cdd99cb
1 ;;; -*- mode: lisp -*-
3 ;;;; defsys -- System setup for CL version of Lisp-Stat
4 ;;;;
5 ;;;; Copyright (c) 1991, by Luke Tierney. Permission is granted for
6 ;;;; unrestricted use.
8 #+kcl
9 (dolist (f *features*)
10 (if (symbolp f)
11 (pushnew (intern (symbol-name f) 'keyword) *features*)))
13 #-:mcl(require :lspackages)
14 #-:mcl(require :lsmacros)
16 ;;;;
17 ;;;; Macintosh CL
18 ;;;;
20 #+:mcl (pushnew :CLtL2 *features*)
21 #+:mcl (def-logical-directory "mcls;" "ccl;:MCLS:")
22 #+:mcl (setf *break-on-errors* nil)
23 #+:mcl (set-mac-default-directory "mcls;")
24 #+:mcl (setf *save-definitions* t)
25 #+:mcl (defpackage "COMMON-LISP" (:nicknames "CL" "LISP"))
26 #+:mcl (pushnew :stat-float-is-double-float *features*)
27 #+:mcl (require :ff)
29 ;;;;
30 ;;;; AKCL
31 ;;;;
33 ;#+:kcl (proclaim '(optimize (safety 2) (space 3) (speed 3)))
34 #+:kcl (setf *break-enable* nil)
36 #+:kcl (allocate 'cons 600)
37 #+:kcl (allocate 'cfun 1000)
38 #+:kcl (si:allocate-relocatable-pages 100)
40 ;; **** This feature should only be used if the patches in num_sfun.c
41 ;; **** and numlib.lsp habe been applied to AKCL -- see lsfloat.lsp for
42 ;; **** more details.
44 ;#+:kcl (pushnew :stat-float-is-double-float *features*)
46 ;;;;
47 ;;;; EXCL (Allegro)
48 ;;;;
50 (setf *read-default-float-format* 'double-float)
52 ;;;;
53 ;;;; Switch to Lisp-Stat package
54 ;;;;
56 #+:mcl (load "lspackages")
57 #+:mcl (load "lsmacros")
59 (in-package :lispstat)
61 (export '(*default-path* debug nodebug))
63 (defvar *common-lisp-stat-version* "1.0 Alpha 1")
65 (defvar *default-path* "./")
67 ;;;;
68 ;;;; Functions for switching into and out of debug mode
69 ;;;;
71 (defun debug ()
72 #+:kcl (setf *break-enable* t)
73 #+:mcl (setf *break-on-errors* t))
75 (defun nodebug ()
76 #+:kcl (setf *break-enable* nil)
77 #+:mcl (setf *break-on-errors* nil))
79 ;;;;
80 ;;;; MCL definitions
81 ;;;;
83 #+:mcl (setf *default-path* ":")
85 ;;;;
86 ;;;; AKCL definitions
87 ;;;;
89 #+:kcl (setf *clibs*
90 #+:mips "lib/clib.a -lm_G0 -lc_G0"
91 #-:mips "lib/clib.a -lm -lc")
93 ;;;;
94 ;;;; EXCL definitions
95 ;;;;
97 ;;;;
98 ;;;; Compilation and Loading Utilities
99 ;;;;
101 (defvar *lsos-files* (list "lsobjects"))
103 (defvar *basic-files*
104 (list #+:kcl "kclpatch"
105 #+:mcl "mclglue"
106 #+:excl "exclglue"
107 "lsbasics"
108 "lsfloat"
109 "fastmap"
110 "compound"
111 "matrices"
112 "ladata"
113 "linalg"
114 "dists"))
116 (defvar *ls-files*
117 (list "lsmath"
118 ; #-:kcl "help"
119 "statistics"
120 "regression"
121 "nonlin"
122 "maximize"
123 "bayes"
124 "lstoplevel"))
126 (defun use-ls-package (name)
127 (shadowing-import (package-shadowing-symbols name))
128 (use-package name))
130 (defun use-stats ()
131 #+:kcl (shadowing-import '(ls::x))
132 (use-ls-package 'lisp-stat-object-system)
133 (use-ls-package 'lisp-stat-basics)
134 (use-ls-package 'lisp-stat))
136 (defun lispfile (x)
137 (concatenate 'string x
138 #+:kcl ".lsp"
139 #+(or :mcl :excl) ".lisp"))
141 (defun load-files (files)
142 (dolist (f files) (load f :verbose t)))
144 (defun compile-load-files (files &optional (load t))
145 (dolist (f files)
146 #+:mcl (format t "compiling ~a~%" f)
147 #+:excl (load (lispfile f))
148 (compile-file f)
149 (if load (load f))))
151 (defun load-lsos ()
152 (load-files *lsos-files*))
154 (defun load-ls-basics ()
155 (load-lsos)
156 (load-files *basic-files*)
157 #+:kcl (if (and (probe-file "kclglue.o")
158 (probe-file "lib/clib.a"))
159 (si:faslink "kclglue" *clibs*)))
161 (defun load-stats ()
162 (load-ls-basics)
163 (load-files *ls-files*))
165 (defun compile-lsos ()
166 (compile-load-files *lsos-files*))
168 (defun compile-ls-basics (&optional (compile-all t))
169 (if compile-all (compile-lsos) (load-lsos))
170 (compile-load-files *basic-files*)
171 #+:kcl (progn (compile-file "kclglue")
172 (si:faslink "kclglue" *clibs*)))
174 (defun compile-stats (&optional (compile-all t))
175 (if compile-all (compile-ls-basics) (load-ls-basics))
176 (compile-load-files *ls-files*))