help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Setting numeric value according to symbol with cl-case


From: Stefan Monnier
Subject: Re: Setting numeric value according to symbol with cl-case
Date: Sun, 30 Oct 2022 08:57:04 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>   (setq mbcomplt
>           (cl-case armg
>               ('auto 0)
>               ('icomplt-horz 1)
>               ('icomplt-vert 2)
>               ('ivy 3)
>               ('vertico 4)
>               ('helm 5)))

Obviously, you should use `pcase` rather than `cl-case` since you
intuitively chose the `pcase` syntax for your patterns (for `cl-case`
they kind of work but don't really do what you think).


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]