all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 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

only message in thread, other threads:[~2018-01-07 15:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180107131517.9297.20852@vcs0.savannah.gnu.org>
     [not found] ` <20180107131518.3583A20487@vcs0.savannah.gnu.org>
2018-01-07 15:46   ` [Emacs-diffs] master 610dad1: Revert "Prevent name clashes between CL structures and builtin types" Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.