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

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

Re: Auto Fill Comments


From: Michael Heerdegen
Subject: Re: Auto Fill Comments
Date: Wed, 02 Dec 2020 00:16:11 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Christopher Dimech <dimech@gmx.com> writes:

> Can someone show me some properly working examples of _ in pcase
> and say what they do?

A simple example?

#+begin_src emacs-lisp
(pcase person
  ('christopher (message "Hello, Christopher!"))
  ('michael) ; do nothing and return nil
  ;; catchall branch:
  (_            (message "Hello, how are you?")))
#+end_src

Of course one can use it, like any other pattern, to assemble compounded
patterns.  It is particularly useful in backquote patterns for example.

IME the `pcase' occurrences in the Emacs sources offer a nice set of
examples, once one has got an idea of the concept.

Michael.



reply via email to

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