AUTOLOAD facility implemented

This commit is contained in:
jjgarcia 2003-08-06 08:50:41 +00:00
parent ee391629b6
commit dff649db13

View file

@ -12,9 +12,10 @@
;;; Program Development Environment
(in-package "SYSTEM")
#+PDE
(progn
(in-package "SYSTEM")
(setq *record-source-pathname-p* nil)
(defun record-source-pathname (symbol type)
;; type is either:
@ -37,9 +38,6 @@
(put-sysprop symbol alist (car type))))))
)
;;; Go into LISP.
(in-package "LISP")
(defun lisp-implementation-type ()
"Args: ()
Returns the string \"ECL\"."
@ -51,60 +49,20 @@ Returns the string \"ECL\"."
(defvar *compile-file-truename* nil)
(defun autoload (pathname &rest function-names)
(dolist (fname function-names)
(let ((thename fname))
(fset fname #'(lambda (&rest args)
(load pathname)
(apply thename args))))))
(unless (fboundp 'compile)
(defun proclaim (d)
"Args: (decl-spec)
Gives a global declaration. See DECLARE for possible DECL-SPECs."
(when (eq (car d) 'SPECIAL) (mapc #'sys::*make-special (cdr d))))
(when (eq (car d) 'SPECIAL) (mapc #'sys::*make-special (cdr d))))
(defun compile-file (&rest args)
"Args: (input-pathname
&key output-file (load nil)
(o-file t) (c-file nil) (h-file nil) (data-file nil))
Compiles the file specified by INPUT-PATHNAME and generates a fasl file
specified by OUTPUT-FILE. If the filetype is not specified in INPUT-PATHNAME,
then \".lsp\" is used as the default file type for the source file. LOAD
specifies whether to load the generated fasl file after compilation. The
:O-FILE, :C-FILE, :H-FILE, and :DATA-FILE keyword parameters allow you to
control the intermediate files generated by the ECL compiler.If the file was
compiled successfully, returns the pathname of the compiled file"
(load "SYS:cmp")
(apply 'compile-file args))
(defun compile (&rest args)
"Args: (name &optional (definition nil))
If DEFINITION is NIL, NAME must be the name of a not-yet-compiled function.
In this case, COMPILE compiles the function, installs the compiled function as
the global function definition of NAME, and returns NAME. If DEFINITION is
non-NIL, it must be a lambda expression and NAME must be a symbol. COMPILE
compiles the lambda expression, installs the compiled function as the function
definition of NAME, and returns NAME. There is only one exception for this:
If NAME is NIL, then the compiled function is not installed but is simply
returned as the value of COMPILE. In any case, COMPILE creates temporary
files, whose filenames begin with \"gazonk\", which are automatically deleted
after compilation."
(load "SYS:cmp")
(apply 'compile args))
(defun compile-file-pathname (&rest args)
(load "SYS:cmp")
(apply 'compile-file-pathname args))
(defun disassemble (f &rest args)
"Args: (&optional (thing nil) &key (h-file nil) (data-file nil))
Compiles the form specified by THING and prints the intermediate C language
code for that form. But does not install the result of compilation. If THING
is NIL, then the previously DISASSEMBLEd form is re-DISASSEMBLEd. If THING is
a symbol that names a function not yet compiled, the function definition is
disassembled. If THING is a lambda expression, it is disassembled as a
function definition. Otherwise, THING itself is disassembled as a top-level
form. H-FILE and DATA-FILE specify intermediate files to build a fasl file
from the C language code. NIL means \"do not create the file\"."
(when (si::valid-function-name-p f)
(setq function (fdefinition f)))
(unless (si::bc-disassemble f)
(load "SYS:cmp")
(apply 'disassemble f args)))
(autoload "SYS:cmp" 'compile-file 'compile 'compile-file-pathname 'disassemble)
)
(defmacro with-compilation-unit (options &rest body)
@ -121,8 +79,6 @@ Report for details."
;;; Allocator.
(in-package "SYSTEM")
(defvar *type-list*
'(cons
;; fixnum Beppe