source: trunk/abcl/src/org/armedbear/lisp/boot.lisp

Last change on this file was 15748, checked in by Mark Evenson, 5 months ago

Add gray-streams:stream-line-length extension

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 6.7 KB
Line 
1;;; boot.lisp
2;;;
3;;; Copyright (C) 2003-2007 Peter Graves <peter@armedbear.org>
4;;; $Id: boot.lisp 15748 2023-11-20 16:14:09Z mevenson $
5;;;
6;;; This program is free software; you can redistribute it and/or
7;;; modify it under the terms of the GNU General Public License
8;;; as published by the Free Software Foundation; either version 2
9;;; of the License, or (at your option) any later version.
10;;;
11;;; This program is distributed in the hope that it will be useful,
12;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14;;; GNU General Public License for more details.
15;;;
16;;; You should have received a copy of the GNU General Public License
17;;; along with this program; if not, write to the Free Software
18;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
19;;;
20;;; As a special exception, the copyright holders of this library give you
21;;; permission to link this library with independent modules to produce an
22;;; executable, regardless of the license terms of these independent
23;;; modules, and to copy and distribute the resulting executable under
24;;; terms of your choice, provided that you also meet, for each linked
25;;; independent module, the terms and conditions of the license of that
26;;; module.  An independent module is a module which is not derived from
27;;; or based on this library.  If you modify this library, you may extend
28;;; this exception to your version of the library, but you are not
29;;; obligated to do so.  If you do not wish to do so, delete this
30;;; exception statement from your version.
31
32(sys:%in-package "SYSTEM")
33
34(setq *load-verbose*     nil)
35(setq *autoload-verbose* nil)
36
37;; Redefined in macros.lisp.
38(defmacro in-package (name)
39  (list '%in-package (string name)))
40
41(defmacro lambda (lambda-list &rest body)
42  (list 'function (list* 'lambda lambda-list body)))
43
44(defmacro named-lambda (name lambda-list &rest body)
45  (list 'function (list* 'named-lambda name lambda-list body)))
46
47;; Redefined in macros.lisp.
48(defmacro return (&optional result)
49  (list 'return-from nil result))
50
51;; Redefined in precompiler.lisp.
52(defmacro defun (name lambda-list &rest body)
53  (let ((block-name (fdefinition-block-name name)))
54    (list '%defun
55          (list 'quote name)
56          (list 'lambda lambda-list (list* 'block block-name body)))))
57
58;; Redefined in macros.lisp.
59(defmacro defconstant (name initial-value &optional docstring)
60  (list '%defconstant (list 'quote name) initial-value docstring))
61
62;; Redefined in macros.lisp.
63(defmacro defparameter (name initial-value &optional docstring)
64  (list '%defparameter (list 'quote name) initial-value docstring))
65
66(defmacro declare (&rest ignored) nil)
67
68(in-package #:extensions)
69
70(export '(%car %cdr %cadr %caddr))
71
72(defmacro %car (x)
73  (list 'car (list 'truly-the 'cons x)))
74
75(defmacro %cdr (x)
76  (list 'cdr (list 'truly-the 'cons x)))
77
78(defmacro %cadr (x)
79  (list '%car (list '%cdr x)))
80
81(defmacro %caddr (x)
82  (list '%car (list '%cdr (list '%cdr x))))
83
84(in-package #:system)
85
86;; Redefined in precompiler.lisp.
87(defun eval (form)
88  (%eval form))
89
90;; Redefined in pprint.lisp.
91(defun terpri (&optional output-stream)
92  (%terpri output-stream))
93
94;; Redefined in pprint.lisp.
95(defun fresh-line (&optional output-stream)
96  (%fresh-line output-stream))
97
98;; Redefined in pprint.lisp.
99(defun write-char (character &optional output-stream)
100  (%write-char character output-stream))
101
102(in-package #:extensions)
103
104;; Redefined in pprint.lisp.
105(defun charpos (stream)
106  (sys::stream-charpos stream))
107
108;; Redefined in pprint.lisp.
109(defun (setf charpos) (new-value stream)
110  (sys::stream-%set-charpos stream new-value))
111
112(export 'charpos '#:extensions)
113
114;; Redefined in pprint.lisp and gray-streams.lisp
115(defun line-length (stream)
116  (declare (ignore stream))
117  (max 0 (or *print-right-margin* 80)))
118
119(export 'line-length '#:extensions)
120
121;; Redefined in precompiler.lisp.
122(defun precompile (name &optional definition)
123  (declare (ignore name definition))
124  nil)
125
126(export 'precompile '#:extensions)
127
128(in-package #:system)
129
130(defun simple-format (destination control-string &rest args)
131  (apply #'format destination control-string args))
132
133(export 'simple-format '#:system)
134
135;; INVOKE-DEBUGGER is redefined in debug.lisp.
136(defun invoke-debugger (condition)
137  (sys::%format t "~A~%" condition)
138  (ext:quit))
139
140;;Redefined in extensible-sequences.lisp
141(defun length (sequence)
142  (%length sequence))
143
144(defun elt (sequence index)
145  (%elt sequence index))
146
147(defun subseq (sequence start &optional end)
148  (sys::%subseq sequence start end))
149
150(defun reverse (sequence)
151  (sys::%reverse sequence))
152
153(defun nreverse (sequence)
154  (sys::%nreverse sequence))
155
156(load-system-file "autoloads-gen")
157(load-system-file "autoloads")
158(load-system-file "early-defuns")
159(load-system-file "backquote")
160(load-system-file "destructuring-bind")
161(load-system-file "defmacro")
162(load-system-file "setf")
163(load-system-file "fdefinition")
164(load-system-file "featurep")
165(load-system-file "read-conditional")
166(load-system-file "macros")
167
168;; Redefined in package.lisp
169(defun make-package (package-name &key nicknames use)
170  (%make-package package-name nicknames use))
171
172(load-system-file "read-circle")
173
174(copy-readtable +standard-readtable+ *readtable*)
175
176;; SYS::%COMPILE is redefined in precompiler.lisp.
177(defun sys::%compile (name definition)
178  (values (if name name definition) nil nil))
179
180(load-system-file "inline")
181(load-system-file "proclaim")
182(load-system-file "arrays")
183(load-system-file "compiler-macro")
184(load-system-file "subtypep")
185(load-system-file "typep")
186(load-system-file "signal")
187(load-system-file "list")
188(load-system-file "require")
189;; precompiler has a large performance benefit on interpreted code
190;; load as early as possible
191(load-system-file "precompiler")
192(load-system-file "extensible-sequences-base")
193(load-system-file "sequences")
194(load-system-file "error")
195(load-system-file "defpackage")
196(load-system-file "define-modify-macro")
197(load-system-file "defstruct")
198
199;; The actual stream and system-stream classes
200;; are created in BuiltInClass.java, however, that code does not
201;; set up the structure internals correctly: we wouldn't be able
202;; to :include the structure classes. Fix that here.
203(defstruct (stream (:constructor nil)
204                   (:copier nil)
205                   (:predicate nil)))  ;; Predicate STREAMP defined elsewhere
206(defstruct (system-stream (:include stream)
207                          (:constructor nil)
208                          (:copier nil)))
209
210(load-system-file "restart")
211(load-system-file "late-setf")
212(load-system-file "debug")
213(load-system-file "print")
214(load-system-file "pprint-dispatch")
215(load-system-file "defsetf")
216(load-system-file "package")
217
218(unless (featurep :j)
219  (unless *noinform*
220    (%format t "Startup completed in ~A seconds.~%"
221             (float (/ (ext:uptime) 1000)))))
222
223
Note: See TracBrowser for help on using the repository browser.