[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 610dad1: Revert "Prevent name clashes between C
From: |
Stefan Monnier |
Subject: |
Re: [Emacs-diffs] master 610dad1: Revert "Prevent name clashes between CL structures and builtin types" |
Date: |
Sun, 07 Jan 2018 10:46:30 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> 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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Emacs-diffs] master 610dad1: Revert "Prevent name clashes between CL structures and builtin types",
Stefan Monnier <=