emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] pcase.el: Add type pattern


From: Michael Heerdegen
Subject: Re: [PATCH] pcase.el: Add type pattern
Date: Wed, 11 Mar 2020 03:08:51 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Adam Porter <address@hidden> writes:

> The (pcase-defmacro type) form expands to:
>
>   (progn
>     (defun type--pcase-macroexpander
>         (type)
>       ;; [long docstring omitted here]
>       `(pred
>         (pcase--flip cl-typep ',type)))
>     (define-symbol-prop 'type--pcase-macroexpander 'edebug-form-spec 'nil)
>     (define-symbol-prop 'type 'pcase-macroexpander 
> #'type--pcase-macroexpander))
>
> My understanding is that the autoload cookie causes the entire
> cl-macs.el file to be loaded when the type--pcase-macroexpander function
> is called, which then causes cl-lib to be loaded.  So an additional
> (require 'cl-lib) would be redundant.  However, as I said, there are
> nuances to autoloading that I haven't grokked yet, so I may be missing
> something.

You understand better than me at least... Ok, `pcase--macroexpand' finds
the expander function by looking at the symbol property, and when
compiling the pattern the expander function is called to expand and
"cl-macs" gets loaded.  That should be alright.

Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]