X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fearly-full-eval.lisp;h=aa95aaaabda574ce63d71a7165c2752d12739847;hb=eac461c1f1ca91cfe282c779291d582ed6b336cb;hp=fd7f2039945ae96441675d8bd1801248093fc015;hpb=970dd272dc84f7420252eadb4829cc193f795716;p=sbcl.git diff --git a/src/code/early-full-eval.lisp b/src/code/early-full-eval.lisp index fd7f203..aa95aaa 100644 --- a/src/code/early-full-eval.lisp +++ b/src/code/early-full-eval.lisp @@ -12,23 +12,21 @@ (in-package "SB!EVAL") (defparameter *eval-level* -1) -(defparameter *eval-calls* 0) (defparameter *eval-verbose* nil) -(defun !full-eval-cold-init () - (setf *eval-level* -1 - *eval-calls* 0 - *eval-verbose* nil - *evaluator-mode* :compile)) - ;; !defstruct-with-alternate-metaclass is unslammable and the ;; RECOMPILE restart doesn't work on it. This is the main reason why ;; this stuff is split out into its own file. Also, it lets the ;; INTERPRETED-FUNCTION type be declared before it is used in -;; compiler/main. +;; compiler/main and code/deftypes-for-target. (sb!kernel::!defstruct-with-alternate-metaclass interpreted-function - :slot-names (name lambda-list env declarations documentation body source-location) + ;; DEBUG-NAME and DEBUG-LAMBDA-LIST are initially a copies of the proper + ;; ones, but is analogous to SIMPLE-FUN-NAME and ARGLIST in the sense that it + ;; is they are there only for debugging, and do not affect behaviour of the + ;; function -- so DEFMACRO can set them to more informative values. + :slot-names (name debug-name lambda-list debug-lambda-list env + declarations documentation body source-location) :boa-constructor %make-interpreted-function :superclass-name function :metaclass-name static-classoid @@ -36,21 +34,23 @@ :dd-type funcallable-structure :runtime-type-checks-p nil) -(defun make-interpreted-function - (&key name lambda-list env declarations documentation body source-location) - (let ((function (%make-interpreted-function - name lambda-list env declarations documentation body - source-location))) - (setf (sb!kernel:funcallable-instance-fun function) - #'(lambda (&rest args) - (interpreted-apply function args))) - function)) - -(defun interpreted-function-p (function) - (typep function 'interpreted-function)) - -(sb!int:def!method print-object ((obj interpreted-function) stream) - (print-unreadable-object (obj stream - :identity (not (interpreted-function-name obj))) - (format stream "~A ~A" '#:interpreted-function - (interpreted-function-name obj)))) +#-sb-xc-host +(progn + (defun make-interpreted-function + (&key name lambda-list env declarations documentation body source-location) + (let ((function (%make-interpreted-function + name name lambda-list lambda-list env + declarations documentation body source-location))) + (setf (sb!kernel:funcallable-instance-fun function) + #'(lambda (&rest args) + (interpreted-apply function args))) + function)) + + (defun interpreted-function-p (function) + (typep function 'interpreted-function)) + + (sb!int:def!method print-object ((obj interpreted-function) stream) + (print-unreadable-object (obj stream + :identity (not (interpreted-function-name obj))) + (format stream "~A ~A" '#:interpreted-function + (interpreted-function-name obj)))))