[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Re: cond* vs pcase
From: |
Drew Adams |
Subject: |
RE: [External] : Re: cond* vs pcase |
Date: |
Wed, 7 Feb 2024 17:09:26 +0000 |
> >>> (pcase foo
> >>> ('bar (do-some-bar-stuff))
> >>> ('baz (do-some-baz-fluff)))
> >>> is not more awful or wonderful than:
> >>> (cl-case foo
> >>> (bar (do-some-bar-stuff))
> >>> (baz (do-some-baz-fluff)))
>
> Sorry to interject, but this really suggests
> that `cl-case' should become, simply, `case',
> in subr.el this time around...
Dunno if it suggests that, but yes, I've
argued that for a long time. Emacs should
just adopt it as `case'. (It _used to be_
just `case', BTW, but it was in `cl.el'.)
And it wouldn't hurt for Emacs to allow an
optional TEST arg for the equality predicate.
That also serves as the membership predicate,
i.e., for clauses such as this:
((foo bar toto) (handle-foo-bar-and-toto))
(An optional KEY arg isn't needed, since
`case' is simple - it uses the same part of
the input value for all clauses - just apply
whatever KEY selector you need to the input
sexp. Another example of `case' simplicity.)
And adding optional TEST wouldn't bother
any existing uses of `cl-case'. `cl-case
could be aliased to the new `case' (or not).
- Re: cond* vs pcase, (continued)
- Re: cond* vs pcase, Alfred M. Szmidt, 2024/02/06
- Re: cond* vs pcase, Philip Kaludercic, 2024/02/06
- Re: cond* vs pcase, Alfred M. Szmidt, 2024/02/06
- Re: cond* vs pcase, Philip Kaludercic, 2024/02/06
- RE: [External] : Re: cond* vs pcase, Drew Adams, 2024/02/06
- RE: [External] : Re: cond* vs pcase, Drew Adams, 2024/02/06
- RE: [External] : Re: cond* vs pcase, Adam Porter, 2024/02/06
- RE: [External] : Re: cond* vs pcase, Drew Adams, 2024/02/06
- Re: [External] : Re: cond* vs pcase, Arthur Miller, 2024/02/07
- Re: [External] : Re: cond* vs pcase, Po Lu, 2024/02/07
- RE: [External] : Re: cond* vs pcase,
Drew Adams <=
- Re: [External] : Re: cond* vs pcase, Tomas Hlavaty, 2024/02/07
- Re: [External] : Re: cond* vs pcase, Richard Stallman, 2024/02/08
- Re: [External] : Re: cond* vs pcase, Arthur Miller, 2024/02/08
- Re: [External] : Re: cond* vs pcase, Alfred M. Szmidt, 2024/02/07
- Re: [External] : Re: cond* vs pcase, Po Lu, 2024/02/07
- Re: [External] : Re: cond* vs pcase, Philip Kaludercic, 2024/02/07
- Re: [External] : Re: cond* vs pcase, Po Lu, 2024/02/07
- Re: [External] : Re: cond* vs pcase, Eli Zaretskii, 2024/02/08
- Re: [External] : Re: cond* vs pcase, Alfred M. Szmidt, 2024/02/08
- Re: [External] : Re: cond* vs pcase, Alfred M. Szmidt, 2024/02/08