emacs-devel
[Top][All Lists]
Advanced

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

Re: pcase defuns


From: Richard Stallman
Subject: Re: pcase defuns
Date: Sun, 19 Dec 2021 23:43:04 -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 see a substantive drawback with this way of defining functions.
Where is "the definition of mytest"?  What place should commands take
you to, when you ask to move to the definition?

What if different cases are defined in different files?  That would be
very confusing.

Another confusing thing is that it doesn't work anything like `pcase'.

There is a benefit to putting all these cases into one form:

(defun mytest (&rest args)
  (CASE-CONSTRUCT args
    (PATTERN ;; Match on 'a 'b with the third argument a wildcard
     "a b match")

    (PATTERN ;; Match on 'c binding VAR, with the third argument a wildcard
     (format "c %s match" var)) ))

That adds two additional lines, and three spaces of indentation,
and it avoids cans of worms.

-- 
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]