1.0.16.35: improved TIME output
[sbcl/pkhuong.git] / src / code / early-full-eval.lisp
blob97c85ef867631ddc52a29efd9e0cdf8ee1cec510
1 ;;;; An interpreting EVAL
3 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; more information.
5 ;;;;
6 ;;;; This software is derived from the CMU CL system, which was
7 ;;;; written at Carnegie Mellon University and released into the
8 ;;;; public domain. The software is in the public domain and is
9 ;;;; provided with absolutely no warranty. See the COPYING and CREDITS
10 ;;;; files for more information.
12 (in-package "SB!EVAL")
14 (defparameter *eval-level* -1)
15 (defparameter *eval-verbose* nil)
17 ;; !defstruct-with-alternate-metaclass is unslammable and the
18 ;; RECOMPILE restart doesn't work on it. This is the main reason why
19 ;; this stuff is split out into its own file. Also, it lets the
20 ;; INTERPRETED-FUNCTION type be declared before it is used in
21 ;; compiler/main and code/deftypes-for-target.
22 (sb!kernel::!defstruct-with-alternate-metaclass
23 interpreted-function
24 :slot-names (name lambda-list env declarations documentation body source-location)
25 :boa-constructor %make-interpreted-function
26 :superclass-name function
27 :metaclass-name static-classoid
28 :metaclass-constructor make-static-classoid
29 :dd-type funcallable-structure
30 :runtime-type-checks-p nil)
32 #-sb-xc-host
33 (progn
34 (defun make-interpreted-function
35 (&key name lambda-list env declarations documentation body source-location)
36 (let ((function (%make-interpreted-function
37 name lambda-list env declarations documentation body
38 source-location)))
39 (setf (sb!kernel:funcallable-instance-fun function)
40 #'(lambda (&rest args)
41 (interpreted-apply function args)))
42 function))
44 (defun interpreted-function-p (function)
45 (typep function 'interpreted-function))
47 (sb!int:def!method print-object ((obj interpreted-function) stream)
48 (print-unreadable-object (obj stream
49 :identity (not (interpreted-function-name obj)))
50 (format stream "~A ~A" '#:interpreted-function
51 (interpreted-function-name obj)))))