emacs-devel
[Top][All Lists]
Advanced

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

Instead of pcase


From: Richard Stallman
Subject: Instead of pcase
Date: Wed, 15 Nov 2023 22:04:37 -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. ]]]

`pcase' is a big and unnecessary complication on Emacs Lisp.
I think its presence worse overall.

One can easily think of `pcase' as "just another feature", like each
of the thousands of other predefined functions and macros in Emacs
Lisp.  But that picture is incorrect for `pcase', because it does not
count the cost of `pcase' in complexity.

What makes `pcase' such a complication is that it introduces an
additional "little language" that duplicates the functionality of part
of Emacs Lisp.  Even worse, that little language is so concise it is
downright cryptic.

I can see why people want something along those lines.  Using `cond'
and `let' to do these jobs feels long-winded and cumbersome; they were
not designed to make this easy.  So we wish for something to make such
code more concise.

`pcase' does indeed make such code more concise, but it takes that
conciseness to an extreme by defining its own cryptic little language,
That is going too far.

Using `pcase' in your own private code concerns you alone.  Using it
in released packages that others use but others rarely change or study
is not a big deal for the community.  However, putting `pcase' into
many packages imposes this cryptic little language on all of us.

There are other little languages in Emacs, but most of them are
limited to special high-level purposes -- which means that hardly any
of us need even be aware of them.

For instance, there is a little language called "quail" which is used
for concisely defining input methods.  Its specific purpose is a
high-level purpose.  If you don't work on input methods you never need
to learn quail.

It's just the opposite for `pcase' -- its specific purpose is a
low-level purpose, so it could appear in any part of the code of
Emacs, The burden of its complexity can fall on any or all of us.

Those of you who are fans of `pcase' may not recognize the cost it
imposes on the Emacs Lisp language.  You paid that cost already,
perhaps a few years ago, and perhaps you enjoy each new language
construct you learn.  Perhaps, for you, the more complexity of
features to be learned, the better.

But don't argue that this cost does not exist, simply because it
doesn't feel like a burden to you.

So...

I'm looking at adapting some of the features of `pcase' into other
constructs, so as to make type-discrimination code more concise than
in old-fashioned Lisp, but _not_ so concise as to be cryptic and
burdensome.

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