X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcode%2Fshow.lisp;h=b1ecc30b47c450bcd606a62a96562ab16b594158;hb=ce02ab2ecd9c6ae2e570abd8c93ebf3be55bbdad;hp=c786dea0f6b853d6c4e8b092faab3a4b86a44454;hpb=53e7a02c819090af8e6db7e47d29cdbb5296814f;p=sbcl.git diff --git a/src/code/show.lisp b/src/code/show.lisp index c786dea..b1ecc30 100644 --- a/src/code/show.lisp +++ b/src/code/show.lisp @@ -83,20 +83,47 @@ ;;; a trivial version of /SHOW which only prints a constant string, ;;; implemented at a sufficiently low level that it can be used early -;;; in cold load +;;; in cold init ;;; ;;; Unlike the other /SHOW-related functions, this one doesn't test ;;; */SHOW* at runtime, because messing with special variables early ;;; in cold load is too much trouble to be worth it. -(defmacro /show0 (s) - (declare (type simple-string s)) - (declare (ignorable s)) ; (for when #!-SB-SHOW) - #+sb-xc-host `(/show ,s) - #-sb-xc-host `(progn - #!+sb-show - (sb!sys:%primitive print - ,(concatenate 'simple-string "/" s)))) +(defmacro /show0 (&rest string-designators) + ;; We can't use inline MAPCAR here because, at least in 0.6.11.x, + ;; this code gets compiled before DO-ANONYMOUS is defined. + (declare (notinline mapcar)) + (let ((s (apply #'concatenate + 'simple-string + (mapcar #'string string-designators)))) + (declare (ignorable s)) ; (for when #!-SB-SHOW) + #+sb-xc-host `(/show ,s) + #-sb-xc-host `(progn + #!+sb-show + (sb!sys:%primitive print + ,(concatenate 'simple-string "/" s))))) (defmacro /noshow0 (s) (declare (ignore s))) + +;;; low-level display of a string, works even early in cold init +(defmacro /primitive-print (thing) + (declare (ignorable thing)) ; (for when #!-SB-SHOW) + #!+sb-show + (progn + #+sb-xc-host `(/show "(/primitive-print)" ,thing) + #-sb-xc-host `(sb!sys:%primitive print (the simple-string ,thing)))) + +(defmacro /nohexstr (thing) + (declare (ignore thing))) + +;;; low-level display of a system word, works even early in cold init +(defmacro /hexstr (thing) + (declare (ignorable thing)) ; (for when #!-SB-SHOW) + #!+sb-show + (progn + #+sb-xc-host `(/show "(/hexstr)" ,thing) + #-sb-xc-host `(sb!sys:%primitive print (hexstr ,thing)))) + +(defmacro /nohexstr (thing) + (declare (ignore thing))) (/show0 "done with show.lisp")