* Re: [Emacs-diffs] master 610dad1: Revert "Prevent name clashes between CL structures and builtin types"
[not found] ` <20180107131518.3583A20487@vcs0.savannah.gnu.org>
@ 2018-01-07 15:46 ` Stefan Monnier
0 siblings, 0 replies; only message in thread
From: Stefan Monnier @ 2018-01-07 15:46 UTC (permalink / raw)
To: emacs-devel; +Cc: Philipp Stephani
> This reverts commit 151496a4b96430924bc148f85b9c8471d1e132b1.
> That commit breaks bootstrap builds due to a cyclic dependency.
Oh, yes, this part of the bootstrap is a bit tricky!
I suggest you only add the check to the `cl-defstruct` macro.
After all, this is the main entry-point (`cl-define-struct` should not
be used directly anyway) and it's the one that gives the earliest
warning/error.
Stefan
> --- a/lisp/emacs-lisp/cl-preloaded.el
> +++ b/lisp/emacs-lisp/cl-preloaded.el
> @@ -36,7 +36,6 @@
>
> ;;; Code:
>
> -(eval-when-compile (require 'cl-generic))
This definitely needs to go, yes.
> (eval-when-compile (require 'cl-lib))
> (eval-when-compile (require 'cl-macs)) ;For cl--struct-class.
>
> @@ -51,12 +50,6 @@
> (apply #'error string (append sargs args))
> (signal 'cl-assertion-failed `(,form ,@sargs)))))
>
> -(defun cl--struct-name-p (name)
> - "Return t if NAME is a valid structure name for `cl-defstruct'."
> - (and name (symbolp name) (not (keywordp name))
> - (not (memq name (eval-when-compile cl--generic-all-builtin-types)))
> - t))
But this could stay. Just test (boundp 'cl--generic-all-builtin-types)
before using it. I'd add "valid/acceptable/available/can-be" to its
name, tho, otherwise it makes it sound like it will indicate if the
symbol *is* a struct-name.
Stefan
^ permalink raw reply [flat|nested] only message in thread