emacs-devel
[Top][All Lists]
Advanced

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

Re: Instead of pcase


From: Richard Stallman
Subject: Re: Instead of pcase
Date: Sun, 10 Dec 2023 10:14:09 -0500

[[[ To any NSA and FBI agents reading my email: please consider    ]]]
[[[ whether defending the US Constitution against all enemies,     ]]]
[[[ foreign or domestic, requires you to follow Snowden's example. ]]]

I am trying to rewrite `byte-optimize-letX' with cond*,
but I cannot understand its current definition.

Specifically, I can't understand this pcase clause:

    ;; Body is last variable.
    (`(,head ,(and bindings
                   (let last-var (caar (last bindings))))
             ,(and last-var             ; non-linear pattern
                   (pred symbolp) (pred (not keywordp)) (pred (not booleanp))))
     (if (eq head 'let)
         `(progn ,@(mapcar #'cadr bindings))
       `(,head ,(butlast bindings) ,(cadar (last bindings)))))

What case is it meant to handle?  What does that case look like?

The comments cited in that code make no sense to me; I don't know of
any use of `let' or `let*' in which the body would be one of the
variables, and their doc strings don't describe any new usage which
would make that meaningful.

-- 
Dr Richard Stallman (https://stallman.org)
Chief GNUisance of the GNU Project (https://gnu.org)
Founder, Free Software Foundation (https://fsf.org)
Internet Hall-of-Famer (https://internethalloffame.org)





reply via email to

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