[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Code for cond*
From: |
Adam Porter |
Subject: |
Re: Code for cond* |
Date: |
Sun, 21 Jan 2024 14:05:24 -0600 |
User-agent: |
Mozilla Thunderbird |
Dear Richard,
With regard to these comments you made about Pcase and cond*:
cond* has four basic advances over pcase: making bindings that cover
the rest of the body, matching patterns against various data objects
(not forcibly the same one), use of ordinary Lisp expressions as
conditions in clauses, and the abolity to make bindings and continue
with further clauses.
Respectfully, I'd like to point out a few things:
* "making bindings that cover the rest of the body...the ability to make
bindings and continue with further clauses"
As several here have mentioned, this is not universally perceived as an
advance. It can easily lead to ambiguity and cause confusion. It is
not very "Lispy" (similarly to cl-loop, where the bounds of its bindings
are ultimately contained at the top level, but can be introduced without
explicit or obvious bounds).
* "matching patterns against various data objects (not forcibly the same
one)"
Pcase can already do this (e.g. with its `guard' pattern). As well, it
destructures objects that cond* does not, such as maps, structs, and
EIEIO objects.
* "use of ordinary Lisp expressions as conditions in clauses"
Pcase can already do this with its `guard' pattern, which explicitly
demarcates an ordinary Lisp expression.
> I'm going to do some more testing and then install cond*.
Obviously, this is your prerogative. Yet, I would ask you again,
respectfully, to reconsider. Your stated reasons for writing cond* were
various shortcomings of Pcase. Some of those, e.g. the documentation,
have already had volunteers step up to address. The others could also
be addressed in various ways. I've suggested a few, but you haven't
explained the reasons for rejecting them.
It's often suggested that one enhance this or that library in Emacs or
ELPA rather than writing a new one that's similar but different. This
seems like one of those cases. Why write a cond* expression, given its
relative limitations, when one might need to rewrite it as Pcase later,
given Pcase's other abilities?
As well, it's already a complaint by some that having to learn Pcase is
a burden. How will that burden be helped by having to learn both Pcase
and cond*?
Thanks for your work on Emacs.
Sincerely,
Adam Porter
- Code for cond*, Richard Stallman, 2024/01/17
- Re: Code for cond*, Andrea Corallo, 2024/01/18
- Re: Code for cond*, Stefan Kangas, 2024/01/24
- Re: Code for cond*, João Távora, 2024/01/24
- Re: Code for cond*, João Távora, 2024/01/24
- Re: Code for cond*, Po Lu, 2024/01/24
- Re: Code for cond*, Ihor Radchenko, 2024/01/24
- Re: Code for cond*, Po Lu, 2024/01/24
- Re: Code for cond*, Ihor Radchenko, 2024/01/24