help-gnu-emacs
[Top][All Lists]
Advanced

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

pcase with progn


From: Heime
Subject: pcase with progn
Date: Wed, 27 Nov 2024 18:45:22 +0000

Does pcase require progn for multiple commands?

(defun pola-symbol-name (sbl &optional sel)
  "Get the string representation of symbol SBL.  If it is
already a string, return it unchanged."

  (cond
    ((symbolp sbl) (symbol-name sbl))
    ((stringp sbl) sbl)
    (t (pcase sel
         ('nil (error "SBL must be a symbol or a string: %s" sbl))
         ('nil-output nil)
         ('default "unknown")
         ('warn (progn
                  (message "SBL not symbol nor string: %s" sbl)
                  nil))
         ('pass sbl)
         (_ (error "SEL Invalid: %s" sel))))))



Sent with Proton Mail secure email.



reply via email to

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