#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")
;; 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
;; 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"
(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 -."
;; 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)
,@(subseq args 0 required)
,@(subseq args min)))))
\f
-;;;; 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))
+\f
+;;;; FUNCTION and NAMED-LAMBDA
(def-ir1-translator function ((thing) start cont)
#!+sb-doc
(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)))
\f
;;;; FUNCALL
;;; 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"