[Top][All Lists]

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

Re: Installing cond* in core

From: Richard Stallman
Subject: Re: Installing cond* in core
Date: Mon, 29 Jan 2024 22:58:38 -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. ]]]

  > But I think the two pattern languages (that of `cond*`s `match*` and
  > that of Pcase) need to be unified, because they're already too similar
  > to justify having them both.  This would be a very simple change that
  > simplifies the implementation (and the doc) significantly.

When I started designing cond*, I wanted to make its pattern language
more different than it actually is.  Especially I found _ to mean
"match anything and ignore it" to be clunky.  I wanted a simpler way
to say that.

For cdr slots, I found a much more convenient way.  But not for car
slots.  I could not find anything else distinguishable that was
simpler or better than _.  So I went with _.

I did manage to simplify the `pred' and `guard' constructs, replacing
them with constrained variables.

I changed some details of `rx', but that was to make it easier to
implement.  Indeed, it simply calls the Lisp facility `rx'.

Aside from `app', which cond* does not need, is anything else missing
(as opposed to, not yet implemented) from cond* patterns that pcase
has?  For now, I will assume not.

So, how could we make the two pattern languages compatible?

For `rx', I don't object to changing cond*'s `rx' to be compatible
with pcases's.  But I don't want that to implement that myself,
because I expect it to be a pain.  I don't know the pcase code so I
can't undertake to make cond* use that.  Can someone else write this
change in cond*?

For constrained variables, the path I'd be happy with is to make both
cond* and pcase implement both pattern interfaces.  That means cond*
constrained variables (both kinds) and `pred' and `guard'.

I could write that change in cond* if someone else writes the
corresponding change in pcase.

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]