From dce2441bf075367e8ef1e664e286ad6056710f19 Mon Sep 17 00:00:00 2001 From: "Kilian M. Haemmerle" Date: Wed, 23 Feb 2022 22:08:23 +0100 Subject: [PATCH 1/4] Fix keyword bloating in DEFPACKAGE clauses --- packages.lisp | 106 ++++++++++++++++++++++----------------------- test/packages.lisp | 2 +- 2 files changed, 54 insertions(+), 54 deletions(-) diff --git a/packages.lisp b/packages.lisp index e012b02..64703ff 100644 --- a/packages.lisp +++ b/packages.lisp @@ -35,56 +35,56 @@ (defpackage :flexi-streams (:use :cl :trivial-gray-streams) (:nicknames :flex) - (:shadow #+:lispworks :with-accessors - :defconstant) - (:export :*default-eol-style* - :*default-little-endian* - :*substitution-char* - :accept-overlong-sequence - :char-length - :external-format-condition - :external-format-condition-external-format - :external-format-eol-style - :external-format-error - :external-format-encoding-error - :external-format-equal - :external-format-id - :external-format-little-endian - :external-format-name - :flexi-input-stream - :flexi-output-stream - :flexi-io-stream - :flexi-stream - :flexi-stream-bound - :flexi-stream-column - :flexi-stream-external-format - :flexi-stream-element-type - :flexi-stream-element-type-error - :flexi-stream-element-type-error-element-type - :flexi-stream-error - :flexi-stream-out-of-sync-error - :flexi-stream-position - :flexi-stream-stream - :get-output-stream-sequence - :in-memory-stream - :in-memory-stream-closed-error - :in-memory-stream-error - :in-memory-stream-position-spec-error - :in-memory-stream-position-spec-error-position-spec - :in-memory-input-stream - :in-memory-output-stream - :list-stream - :make-external-format - :make-in-memory-input-stream - :make-in-memory-output-stream - :make-flexi-stream - :octet - :octet-length - :octets-to-string - :output-stream-sequence-length - :peek-byte - :string-to-octets - :unread-byte - :vector-stream - :with-input-from-sequence - :with-output-to-sequence)) + (:shadow #+:lispworks #:with-accessors + #:defconstant) + (:export #:*default-eol-style* + #:*default-little-endian* + #:*substitution-char* + #:accept-overlong-sequence + #:char-length + #:external-format-condition + #:external-format-condition-external-format + #:external-format-eol-style + #:external-format-error + #:external-format-encoding-error + #:external-format-equal + #:external-format-id + #:external-format-little-endian + #:external-format-name + #:flexi-input-stream + #:flexi-output-stream + #:flexi-io-stream + #:flexi-stream + #:flexi-stream-bound + #:flexi-stream-column + #:flexi-stream-external-format + #:flexi-stream-element-type + #:flexi-stream-element-type-error + #:flexi-stream-element-type-error-element-type + #:flexi-stream-error + #:flexi-stream-out-of-sync-error + #:flexi-stream-position + #:flexi-stream-stream + #:get-output-stream-sequence + #:in-memory-stream + #:in-memory-stream-closed-error + #:in-memory-stream-error + #:in-memory-stream-position-spec-error + #:in-memory-stream-position-spec-error-position-spec + #:in-memory-input-stream + #:in-memory-output-stream + #:list-stream + #:make-external-format + #:make-in-memory-input-stream + #:make-in-memory-output-stream + #:make-flexi-stream + #:octet + #:octet-length + #:octets-to-string + #:output-stream-sequence-length + #:peek-byte + #:string-to-octets + #:unread-byte + #:vector-stream + #:with-input-from-sequence + #:with-output-to-sequence)) diff --git a/test/packages.lisp b/test/packages.lisp index 0953508..adb0169 100644 --- a/test/packages.lisp +++ b/test/packages.lisp @@ -38,4 +38,4 @@ :normalize-external-format :+name-map+ :+shortcut-map+) - (:export :run-all-tests)) + (:export #:run-all-tests)) From cdef4cb708264be37bef6f040f5057363476fbda Mon Sep 17 00:00:00 2001 From: "Kilian M. Haemmerle" Date: Thu, 24 Feb 2022 10:21:13 +0100 Subject: [PATCH 2/4] Fix keywords bloating *PACKAGE* in test package :IMPORT-FROM clause --- test/packages.lisp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/test/packages.lisp b/test/packages.lisp index adb0169..94cf265 100644 --- a/test/packages.lisp +++ b/test/packages.lisp @@ -31,11 +31,11 @@ (defpackage :flexi-streams-test (:use :cl :flexi-streams) - (:import-from :flexi-streams - :with-unique-names - :with-rebinding - :char* - :normalize-external-format - :+name-map+ - :+shortcut-map+) + (:import-from #:flexi-streams + #:with-unique-names + #:with-rebinding + #:char* + #:normalize-external-format + #:+name-map+ + #:+shortcut-map+) (:export #:run-all-tests)) From ec35380ed3dc04f33167f060e362246bb66dcdf3 Mon Sep 17 00:00:00 2001 From: "Kilian M. Haemmerle" <61506792+kilianmh@users.noreply.github.com> Date: Thu, 24 Feb 2022 12:26:56 +0100 Subject: [PATCH 3/4] Revert :IMPORT-FROM clause package name to keyword Reverting test package :IMPORT-FROM clause package name to KEYWORD, which should improve readability without unnecessary expansion of *PACKAGE*. --- test/packages.lisp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/packages.lisp b/test/packages.lisp index 94cf265..c6ac748 100644 --- a/test/packages.lisp +++ b/test/packages.lisp @@ -31,7 +31,7 @@ (defpackage :flexi-streams-test (:use :cl :flexi-streams) - (:import-from #:flexi-streams + (:import-from :flexi-streams #:with-unique-names #:with-rebinding #:char* From 68e5c063e1735897bd8989a2d7b6af2a3a05f3ca Mon Sep 17 00:00:00 2001 From: kilianmh Date: Fri, 22 Jul 2022 18:00:47 +0200 Subject: [PATCH 4/4] Fix symbol internalization in KEYWORD package - STRING as argument for INTERN, FIND-PACKAGE and FIND-SYMBOL -> Avoid internalization of RUN-ALL-TESTS, FLEXI-STREAMS-TEST, STREAM-FILE-POSITION in KEYWORD package --- flexi-streams.asd | 4 ++-- packages.lisp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flexi-streams.asd b/flexi-streams.asd index 2455fe0..764a67d 100644 --- a/flexi-streams.asd +++ b/flexi-streams.asd @@ -70,5 +70,5 @@ (defmethod perform ((o test-op) (c (eql (find-system 'flexi-streams)))) (operate 'load-op 'flexi-streams-test) - (funcall (intern (symbol-name :run-all-tests) - (find-package :flexi-streams-test)))) + (funcall (intern "RUN-ALL-TESTS" + (find-package "FLEXI-STREAMS-TEST")))) diff --git a/packages.lisp b/packages.lisp index 64703ff..6728f1f 100644 --- a/packages.lisp +++ b/packages.lisp @@ -29,7 +29,7 @@ (in-package :cl-user) -(unless (find-symbol (symbol-name :stream-file-position) :trivial-gray-streams) +(unless (find-symbol "STREAM-FILE-POSITION" :trivial-gray-streams) (error "You need a newer version of TRIVIAL-GRAY-STREAMS.")) (defpackage :flexi-streams