-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New pcase patterns such as cl-typep #55
Comments
Hi @tarsius, I consider pcase extensions out of scope of Compat. The pcase library is simply too complex and too difficult to extend, since we have to work with the earliest versions. I've tried porting back pcase-related functionality before and I failed. Iirc we've talked about this before? Nevertheless I am happy to be proven wrong if it is indeed possible to port back certain subsets of the functionality. |
I'm currently backporting the (eval-and-compile ; Needed because we use this pattern below.
(when (< emacs-major-version 28)
(pcase-defmacro cl-type (type)
"Pcase pattern that matches objects of TYPE.
TYPE is a type descriptor as accepted by `cl-typep', which see."
(static-if (< emacs-major-version 30)
`(pred (pcase--flip cl-typep ',type))
;; This isn't actually ever used but we have to hide
;; the above from the byte-compiler for upcoming releases,
;; and might as well include this here to show what the
;; built-in version looks like in those upcoming releases.
`(pred (cl-typep _ ',type)))))) Seems simple enough. |
We talked about |
Please consider backporting newer pcase patterns such as
cl-typep
andeieio
. Beside these two, there are probably some additional patterns that weren't available in the very firstpcase
. Such patterns are defined usingpcase-defmacro
, and take very little code.Thanks for considering!
The text was updated successfully, but these errors were encountered: