diff options
author | Charles Zhang <charleszhang99@yahoo.com> | 2024-05-17 18:40:34 +0200 |
---|---|---|
committer | Charles Zhang <charleszhang99@yahoo.com> | 2024-05-18 02:32:13 +0200 |
commit | b951bc256c6dde6e1a7efb6942fab0de24336bc4 (patch) | |
tree | 7980df326654e3553b69541ae947abc8bf26f1b3 | |
parent | 483374163c0d1a16824bb6c1b10fb02fb9a805a4 (diff) |
Don't have SB-GRAY use SB-KERNEL and define it earlier.
There are only a few exported symbols that need to be qualified if we
unuse SB-KERNEL from SB-GRAY. This allows us to get rid of the forward
declaration.
-rw-r--r-- | src/cold/exports.lisp | 45 | ||||
-rw-r--r-- | src/pcl/gray-streams.lisp | 14 |
2 files changed, 29 insertions, 30 deletions
diff --git a/src/cold/exports.lisp b/src/cold/exports.lisp index 0b69f05a1..fae9c8f2d 100644 --- a/src/cold/exports.lisp +++ b/src/cold/exports.lisp @@ -40,7 +40,6 @@ (defpackage-if-needed "SB-KERNEL") (defpackage-if-needed "SB-ALIEN") (defpackage-if-needed "SB-SYS") - (defpackage-if-needed "SB-GRAY") (defpackage-if-needed "SB-ALIEN-INTERNALS") (defpackage-if-needed "SB-ASSEM") (defpackage-if-needed "SB-C" @@ -989,6 +988,28 @@ possibly temporarily, because it might be used internally.") (:documentation "private: implementation details of LOOP") (:use "CL" "SB-INT" "SB-KERNEL")) +(defpackage "SB-GRAY" + (:documentation + "public: an implementation of the stream-definition-by-user +Lisp extension proposal by David N. Gray") + (:use "CL" "SB-EXT" "SB-INT") + (:export "FUNDAMENTAL-BINARY-STREAM" + "FUNDAMENTAL-BINARY-INPUT-STREAM" + "FUNDAMENTAL-BINARY-OUTPUT-STREAM" "FUNDAMENTAL-CHARACTER-STREAM" + "FUNDAMENTAL-CHARACTER-INPUT-STREAM" + "FUNDAMENTAL-CHARACTER-OUTPUT-STREAM" + "FUNDAMENTAL-INPUT-STREAM" "FUNDAMENTAL-OUTPUT-STREAM" + "FUNDAMENTAL-STREAM" + "STREAM-ADVANCE-TO-COLUMN" "STREAM-CLEAR-INPUT" + "STREAM-CLEAR-OUTPUT" "STREAM-FILE-POSITION" "STREAM-FINISH-OUTPUT" "STREAM-FORCE-OUTPUT" + "STREAM-FRESH-LINE" "STREAM-LINE-COLUMN" "STREAM-LINE-LENGTH" + "STREAM-LISTEN" "STREAM-PEEK-CHAR" "STREAM-READ-BYTE" + "STREAM-READ-CHAR" "STREAM-READ-CHAR-NO-HANG" "STREAM-READ-LINE" + "STREAM-READ-SEQUENCE" "STREAM-START-LINE-P" "STREAM-TERPRI" + "STREAM-UNREAD-CHAR" + "STREAM-WRITE-BYTE" "STREAM-WRITE-CHAR" "STREAM-WRITE-SEQUENCE" + "STREAM-WRITE-STRING")) + (defpackage "SB-UNIX" (:documentation "private: a wrapper layer for SBCL itself to use when talking with @@ -3419,28 +3440,6 @@ is a good idea, but see SB-SYS re. blurring of boundaries.") (:use "CL" "SB-INT") (:export "NORMALIZE-STRING" "NORMALIZED-P")) -(defpackage "SB-GRAY" - (:documentation - "public: an implementation of the stream-definition-by-user -Lisp extension proposal by David N. Gray") - (:use "CL" "SB-EXT" "SB-INT" "SB-KERNEL") - (:export "FUNDAMENTAL-BINARY-STREAM" - "FUNDAMENTAL-BINARY-INPUT-STREAM" - "FUNDAMENTAL-BINARY-OUTPUT-STREAM" "FUNDAMENTAL-CHARACTER-STREAM" - "FUNDAMENTAL-CHARACTER-INPUT-STREAM" - "FUNDAMENTAL-CHARACTER-OUTPUT-STREAM" - "FUNDAMENTAL-INPUT-STREAM" "FUNDAMENTAL-OUTPUT-STREAM" - "FUNDAMENTAL-STREAM" - "STREAM-ADVANCE-TO-COLUMN" "STREAM-CLEAR-INPUT" - "STREAM-CLEAR-OUTPUT" "STREAM-FILE-POSITION" "STREAM-FINISH-OUTPUT" "STREAM-FORCE-OUTPUT" - "STREAM-FRESH-LINE" "STREAM-LINE-COLUMN" "STREAM-LINE-LENGTH" - "STREAM-LISTEN" "STREAM-PEEK-CHAR" "STREAM-READ-BYTE" - "STREAM-READ-CHAR" "STREAM-READ-CHAR-NO-HANG" "STREAM-READ-LINE" - "STREAM-READ-SEQUENCE" "STREAM-START-LINE-P" "STREAM-TERPRI" - "STREAM-UNREAD-CHAR" - "STREAM-WRITE-BYTE" "STREAM-WRITE-CHAR" "STREAM-WRITE-SEQUENCE" - "STREAM-WRITE-STRING")) - (defpackage "SB-MOP" (:documentation "public: the MetaObject Protocol interface, as defined by diff --git a/src/pcl/gray-streams.lisp b/src/pcl/gray-streams.lisp index cb5dcd9fd..ac2ec97c7 100644 --- a/src/pcl/gray-streams.lisp +++ b/src/pcl/gray-streams.lisp @@ -152,7 +152,7 @@ ;; Writing to a string-output-stream adds negligible overhead ;; versus the method dispatch for each input character. (values (with-output-to-string (s) - (let ((ouch (ansi-stream-cout s))) + (let ((ouch (sb-kernel:ansi-stream-cout s))) (loop (let ((ch (stream-read-char stream))) (case ch (#\newline (return)) @@ -182,7 +182,7 @@ (aver (eq :eof eof-value)) (aver (not recursive-p)) (stream-read-char stream)) - #'ill-bin)) + #'sb-kernel:ill-bin)) (defmethod stream-read-sequence ((stream fundamental-binary-input-stream) (seq sequence) @@ -191,7 +191,7 @@ (stream-element-type stream)))) (sb-impl::read-sequence/read-function seq stream start end stream-element-mode - #'ill-in + #'sb-kernel:ill-in (lambda (stream eof-error-p eof-value recursive-p) (aver (null eof-error-p)) (aver (eq :eof eof-value)) @@ -262,8 +262,8 @@ (defmethod stream-write-string ((stream fundamental-character-output-stream) string &optional (start 0) end) - (with-array-data ((data string) (offset-start start) (offset-end end) - :check-fill-pointer t) + (sb-kernel:with-array-data ((data string) (offset-start start) (offset-end end) + :check-fill-pointer t) (sb-impl::write-sequence/vector (data simple-string) stream offset-start offset-end #'stream-write-char)) string) @@ -339,7 +339,7 @@ (seq sequence) &optional (start 0) (end nil)) (sb-impl::write-sequence/write-function - seq stream start end 'character #'stream-write-char #'ill-bout)) + seq stream start end 'character #'stream-write-char #'sb-kernel:ill-bout)) ;; Provide a reasonable default for binary Gray streams. We might be ;; able to do better by specializing on the sequence type, but at @@ -351,7 +351,7 @@ (stream-element-type stream)))) (sb-impl::write-sequence/write-function seq stream start end stream-element-mode - #'ill-out #'stream-write-byte))) + #'sb-kernel:ill-out #'stream-write-byte))) ;;; binary streams |