unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: <tomas@tuxteam.de>
To: help-gnu-emacs@gnu.org
Subject: Re: [el-search] How to search string excluding docstring?
Date: Mon, 25 Dec 2017 20:14:20 +0100	[thread overview]
Message-ID: <20171225191420.GB3245@tuxteam.de> (raw)
In-Reply-To: <86d132n0e0.fsf@zoho.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, Dec 25, 2017 at 07:11:19PM +0100, Emanuel Berg wrote:
> t wrote:
> 
> >> Pattern match, like they have for arguments
> >> in Erlang and SML?
> >
> > Pattern match like pcase, I guess.
> 
> Isn't that the same?

No. Regexps are built to match regular languages. Pcase is
built to match S-expressions, which are beyond regular.
Well-nested parentheses are more than a regular language.

Start with the Chomsky hierarchy[1], and delve as deep as
you like :-)

> AFAIK there isn't any
> native pattern matching i Lisp, but one can do
> it with macros...

whatever you understand by "native pattern matching".

> I don't like it personally because it makes
> writing code neurotic keeping track of all
> those cases, rather than just examine what the
> value is and act accordingly...

It's not a psychological question, but rather a mathematical
one: there are things you can't do with regexps.

> Whenever I use `pcase' it isn't really pattern
> matching in my eyes, i.e. in the Erlang/SML
> sense, more like a way of doing case with
> strings.

There lies your error: you are matching S-expressions, not
strings. The "case" part isn't the exciting one :-)

> I guess it could be used in other ways
> as well. Even tho technically it is the
> same thing.

Hmmm.

Cheers
[1] https://en.wikipedia.org/wiki/Chomsky_hierarchy

- -- tomás
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlpBTgwACgkQBcgs9XrR2kbuAwCdGeCGed8FArdnqKkpQ2sLLnym
SUsAn2Kd5MuqW6LzPW6ZZP0RzXQNlEoA
=F3k5
-----END PGP SIGNATURE-----



  reply	other threads:[~2017-12-25 19:14 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6328.1514197667.27995.help-gnu-emacs@gnu.org>
2017-12-25 12:00 ` [el-search] How to search string excluding docstring? Emanuel Berg
2017-12-25 13:57   ` Chunyang Xu
2017-12-25 14:34     ` Michael Heerdegen
     [not found]   ` <mailman.6334.1514210258.27995.help-gnu-emacs@gnu.org>
2017-12-25 14:08     ` Emanuel Berg
2017-12-25 17:55       ` tomas
     [not found]       ` <mailman.6358.1514224565.27995.help-gnu-emacs@gnu.org>
2017-12-25 18:11         ` Emanuel Berg
2017-12-25 19:14           ` tomas [this message]
     [not found]           ` <mailman.6366.1514229270.27995.help-gnu-emacs@gnu.org>
2017-12-25 19:36             ` Emanuel Berg
2017-12-25 21:20               ` tomas
     [not found]               ` <mailman.6371.1514236843.27995.help-gnu-emacs@gnu.org>
2017-12-25 21:56                 ` Emanuel Berg
2017-12-26  2:44                   ` Emanuel Berg
2017-12-26 13:34                   ` Emanuel Berg
2017-12-26 13:48                     ` Jean-Christophe Helary
     [not found]                     ` <mailman.6381.1514296097.27995.help-gnu-emacs@gnu.org>
2017-12-26 15:19                       ` Emanuel Berg
2017-12-27  5:38                     ` Chunyang Xu
2017-12-27 13:58                       ` Michael Heerdegen
     [not found]                     ` <mailman.6406.1514353148.27995.help-gnu-emacs@gnu.org>
2017-12-27  6:58                       ` Emanuel Berg
2017-12-25 19:39             ` Emanuel Berg
2017-12-25 10:27 Chunyang Xu
2017-12-25 10:40 ` Jean-Christophe Helary
2017-12-25 12:00 ` Skip Montanaro
2017-12-25 18:04   ` Michael Heerdegen
2017-12-25 14:56 ` Michael Heerdegen
2017-12-25 16:58   ` Chunyang Xu
2017-12-25 17:51     ` Michael Heerdegen
     [not found] ` <mailman.6340.1514213787.27995.help-gnu-emacs@gnu.org>
2017-12-25 15:50   ` Emanuel Berg
2017-12-25 16:59     ` Michael Heerdegen
     [not found]     ` <mailman.6351.1514221174.27995.help-gnu-emacs@gnu.org>
2017-12-25 18:04       ` Emanuel Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171225191420.GB3245@tuxteam.de \
    --to=tomas@tuxteam.de \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).