From: William Harold Newman Date: Sun, 30 Dec 2001 21:18:59 +0000 (+0000) Subject: 0.pre7.108: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=6395ade4d85003101ed3391ab3b2df06c6255289;p=sbcl.git 0.pre7.108: trying to fix function debug name mess without imploding the whole system by triggering avalanches of low-level software antiengineering from hell... ...revived SB-INT:NAMED-LAMBDA idea unrelated tidying in SB-INT... ...deleted *OPTIMIZE-FOO* for byte compilation, since there's no byte compiler now ...*PROMPT* has been hidden as an implementation detail for some time and no one has complained, so we might as well delete it. --- diff --git a/package-data-list.lisp-expr b/package-data-list.lisp-expr index 724b2f0..6ffb768 100644 --- a/package-data-list.lisp-expr +++ b/package-data-list.lisp-expr @@ -649,7 +649,7 @@ Lisp extension proposal by David N. Gray" #s(sb-cold:package-data :name "SB!INT" :doc -"private: miscellaneous unsupported extensions to the ANSI spec. Most of +"private: miscellaneous unsupported extensions to the ANSI spec. Much of the stuff in here originated in CMU CL's EXTENSIONS package and is retained, possibly temporariliy, because it might be used internally." :use ("CL" "SB!ALIEN" "SB!C-CALL" "SB!GRAY" "SB!FASL" "SB!SYS") @@ -677,16 +677,6 @@ retained, possibly temporariliy, because it might be used internally." ;; hash mixing operations "MIX" "MIXF" - ;; optimization idioms - "*OPTIMIZE-BYTE-COMPILATION*" - "*OPTIMIZE-EXTERNAL-DESPITE-BYTE-COMPILATION*" - - ;; Arguably there's no one right value for the system - ;; prompt. But Common Lisp makes it easy for you to write - ;; your own REPL if you really care, so I'm not convinced we - ;; need this as a supported extension. - "*PROMPT*" - ;; I'm not convinced that FDEFINITIONs are the ideal ;; solution, so exposing ways to peek into the system ;; seems undesirable, since it makes it harder to get @@ -704,6 +694,9 @@ retained, possibly temporariliy, because it might be used internally." ;; in the cross-compiler's environment "DEF!MACRO" "DEF!METHOD" "DEF!STRUCT" "DEF!TYPE" + ;; stuff for hinting to the compiler + "NAMED-LAMBDA" + ;; other variations on DEFFOO stuff useful for bootstrapping ;; and cross-compiling "DEFMACRO-MUNDANELY" diff --git a/src/code/toplevel.lisp b/src/code/toplevel.lisp index 5a40e8f..8c36aad 100644 --- a/src/code/toplevel.lisp +++ b/src/code/toplevel.lisp @@ -247,10 +247,6 @@ (defvar +++ nil #!+sb-doc "the previous value of ++") (defvar - nil #!+sb-doc "the form currently being evaluated") -;;; the top level prompt string, or a function of no arguments that -;;; returns a simple-string -(defvar *prompt* "* ") - (defun interactive-eval (form) "Evaluate FORM, returning whatever it returns and adjusting ***, **, *, +++, ++, +, ///, //, /, and -." @@ -495,14 +491,11 @@ ;; FIXME: It seems bad to have GC behavior depend on scrubbing the ;; control stack before each interactive command. Isn't there some ;; way we can convince the GC to just ignore dead areas of the - ;; control stack, so that we don't need to rely on this - ;; half-measure? + ;; control stack, so that we don't need to rely on this half-measure? (scrub-control-stack) (unless noprint (fresh-line) - (princ (if (functionp *prompt*) - (funcall *prompt*) - *prompt*)) + (write-string "* ") ; arbitrary but customary REPL prompt (flush-standard-output-streams)) (let ((form (read *standard-input* nil eof-marker))) (cond ((eq form eof-marker) diff --git a/src/compiler/ir1-translators.lisp b/src/compiler/ir1-translators.lisp index 021a7bf..f615c1b 100644 --- a/src/compiler/ir1-translators.lisp +++ b/src/compiler/ir1-translators.lisp @@ -398,13 +398,15 @@ ,@(subseq args 0 required) ,@(subseq args min))))) -;;;; QUOTE and FUNCTION +;;;; QUOTE (def-ir1-translator quote ((thing) start cont) #!+sb-doc "QUOTE Value Return Value without evaluating it." (reference-constant start cont thing)) + +;;;; FUNCTION and NAMED-LAMBDA (def-ir1-translator function ((thing) start cont) #!+sb-doc @@ -434,6 +436,34 @@ (let ((var (find-lexically-apparent-function thing "as the argument to FUNCTION"))) (reference-leaf start cont var)))) + +;;; `(NAMED-LAMBDA ,NAME ,@REST) is like `(FUNCTION (LAMBDA ,@REST)), +;;; except that the value of NAME is passed to the compiler for use in +;;; creation of debug information for the resulting function. +;;; +;;; Eventually we might use this for NAME values other than legal +;;; function names, e.g. +;;; NAME = (:FLET FOO BAR) +;;; for the FLET function in +;;; (DEFUN BAR (X) +;;; (FLET ((FOO (Y) (+ X Y))) +;;; FOO)) +;;; or +;;; NAME = (:METHOD PRINT-OBJECT (STARSHIP T)) +;;; for the function used to implement +;;; (DEFMETHOD PRINT-OBJECT ((SS STARSHIP) STREAM) ...). +;;; However, as of this writing (while defining/implementing it in +;;; sbcl-0.pre7.108) NAME is always a legal function name. +;;; +;;; If NAME is a legal function name, then the caller should be +;;; planning to set (FDEFINITION NAME) to the created function. +;;; (Otherwise the debug names will be inconsistent and thus +;;; unnecessarily confusing.) +(def-ir1-translator named-lambda ((name &rest rest) start cont) + (reference-leaf start + cont + (ir1-convert-lambda `(lambda ,@rest) + :source-name name))) ;;;; FUNCALL diff --git a/version.lisp-expr b/version.lisp-expr index c8d887c..7a487d5 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -18,4 +18,4 @@ ;;; for internal versions, especially for internal versions off the ;;; main CVS branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.pre7.107" +"0.pre7.108"