[Git][cmucl/cmucl][issue-495-describe-deftypes] 3 commits: Add comments to bootstrap file.
Raymond Toy pushed to branch issue-495-describe-deftypes at cmucl / cmucl Commits: 4ed6c57f by Raymond Toy at 2026-04-30T07:04:04-07:00 Add comments to bootstrap file. Just clarify what we're doing and for what issue - - - - - f1a5651a by Raymond Toy at 2026-04-30T07:04:56-07:00 Print out the source location for the deftype The source location is stored in :deftype so we need to use that for the source location instead of :defvar. Updated cmucl.pot for new strings. - - - - - dde2e4ab by Raymond Toy at 2026-04-30T07:22:22-07:00 Cross-compile build needs a cross boostrap file Add new variable "crossboot" to hold the option to specify a cross bootstrap file for cross-build-world to use. In this case, we need one for the deftype changes, and it's the same boot file we would use for the normal build. - - - - - 4 changed files: - .gitlab-ci.yml - src/bootfiles/21f/boot-21f.lisp - src/code/describe.lisp - src/i18n/locale/cmucl.pot Changes: ===================================== .gitlab-ci.yml ===================================== @@ -7,7 +7,11 @@ variables: download_url: "https://common-lisp.net/project/cmucl/downloads/release/$release" version: "$release-x86" tar_ext: "xz" + # bootstrap is for normal builds bootstrap: "-B boot-21f" + # crossboot is for cross-compiles where the cross-compile script + # isn't enough and we need an extra file. + crossboot: "-B src/bootfiles/21f/boot-21f" workflow: rules: @@ -229,7 +233,7 @@ linux:cross-build: script: - bin/create-target.sh xtarget $CONFIG - bin/create-target.sh xcross $CONFIG - - bin/cross-build-world.sh -crl xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp + - bin/cross-build-world.sh $crossboot -crl xtarget xcross src/tools/cross-scripts/cross-x86-x86.lisp snapshot/bin/lisp - bin/build.sh -b xlinux $bootstrap -R -C $CONFIG -o "xtarget/lisp/lisp -lib xtarget/lisp" - bin/make-dist.sh -I xdist xlinux-4 ===================================== src/bootfiles/21f/boot-21f.lisp ===================================== @@ -1,11 +1,20 @@ +;; Bootstrap file for issue #495 to add more information when +;; describing user-defined types. +;; (setf lisp::*enable-package-locked-errors* nil) (in-package "C") -;; deftype information +;; New deftype information. +;; +;; We define a :lambda-list for types where we can store the +;; lambda-list of the deftype. We also add a :defype source-location +;; for deftypes so we don't use :defvar for this. (define-info-type type lambda-list list nil) (define-info-type source-location deftype (or form-numbers null) nil) (in-package "LISP") +;; New deftype macro to saves the lambda-list of the type. %deftype +;; is updated to take the extra arg for the lambda-list. (defmacro deftype (name arglist &body body) "Syntax like DEFMACRO, but defines a new type." (unless (symbolp name) ===================================== src/code/describe.lisp ===================================== @@ -480,18 +480,14 @@ (describe pcl-class))))) ;; ;; Print out information about any types named by the symbol - #+nil - (when (eq (info type kind x) :defined) - (format t (intl:gettext "~&It names a type specifier."))) - (format t "info type kind = ~A~%" (info type kind x)) - (case (info type kind x) + (case (info :type :kind x) (:defined ;; User defined type (format t (intl:gettext "~&It names a type specifier.")) (let ((lambda-list (info type lambda-list x))) (when lambda-list - (format t (intl:gettext "~& Lambda list: ~S") lambda-list))) - (let ((expander (info type expander x))) + (format t (intl:gettext "~& Lambda list: ~S") lambda-list))) + (let ((expander (info :type :expander x))) (when expander (let ((expansion (ignore-errors (funcall expander (list x))))) (when expansion @@ -499,10 +495,10 @@ (list x) expansion)))))) (:primitive ;; Primitive built-in type - (format t (intl:gettext "~&It names a type specifier.")) - (let ((builtin (info type builtin x))) + (format t (intl:gettext "~&It names a primitive type specifier.")) + (let ((builtin (info :type :builtin x))) (when builtin - (format t (intl:gettext "~& Internal type: ~S") builtin))))) + (format t (intl:gettext "~& Internal type: ~S") builtin))))) ;; ;; Print out properties, possibly ignoring implementation details. (do ((plist (symbol-plist X) (cddr plist))) @@ -512,6 +508,15 @@ (describe (cadr plist)))) ;; Describe where it was defined. + ;; + ;; Note: Source location for user-defined types is stored in + ;; :deftype. However :defvar is currently used for defvar, + ;; defparameter, defconstant. Just try printing both :defvar and + ;; :deftype locations. They should be distinct. (let ((locn (info :source-location :defvar x))) (when locn - (format t (intl:gettext "~&It is defined in:~&~A") (c::file-source-location-pathname locn))))) + (format t (intl:gettext "~&It is defined in:~&~A") (c::file-source-location-pathname locn)))) + (let ((locn (info :source-location :deftype x))) + (when locn + (format t (intl:gettext "~&The type is defined in:~&~A") + (c::file-source-location-pathname locn))))) ===================================== src/i18n/locale/cmucl.pot ===================================== @@ -13132,7 +13132,7 @@ msgid "~&It names a type specifier." msgstr "" #: src/code/describe.lisp -msgid "~& Lambda list: ~S" +msgid "~& Lambda list: ~S" msgstr "" #: src/code/describe.lisp @@ -13140,7 +13140,11 @@ msgid "~& Sample expansion: ~S: ~S" msgstr "" #: src/code/describe.lisp -msgid "~& Internal type: ~S" +msgid "~&It names a primitive type specifier." +msgstr "" + +#: src/code/describe.lisp +msgid "~& Internal type: ~S" msgstr "" #: src/code/describe.lisp @@ -13151,6 +13155,10 @@ msgstr "" msgid "~&It is defined in:~&~A" msgstr "" +#: src/code/describe.lisp +msgid "~&The type is defined in:~&~A" +msgstr "" + #: src/code/tty-inspect.lisp msgid "~%That slot is unbound.~%" msgstr "" View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a91d9848fac43732869599e... -- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/a91d9848fac43732869599e... You're receiving this email because of your account on gitlab.common-lisp.net. Manage all notifications: https://gitlab.common-lisp.net/-/profile/notifications | Help: https://gitlab.common-lisp.net/help
participants (1)
-
Raymond Toy (@rtoy)