From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Saving match data Date: Wed, 28 Sep 2016 14:25:12 -0400 Message-ID: References: <87twd0j7fi.fsf@web.de> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1475087243 26936 195.159.176.226 (28 Sep 2016 18:27:23 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Sep 2016 18:27:23 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 28 20:27:19 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bpJZZ-0005va-BQ for ged-emacs-devel@m.gmane.org; Wed, 28 Sep 2016 20:27:13 +0200 Original-Received: from localhost ([::1]:60549 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpJZX-0007fR-RC for ged-emacs-devel@m.gmane.org; Wed, 28 Sep 2016 14:27:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpJY1-0006pV-Ns for emacs-devel@gnu.org; Wed, 28 Sep 2016 14:25:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpJXy-0007ys-Ge for emacs-devel@gnu.org; Wed, 28 Sep 2016 14:25:37 -0400 Original-Received: from [195.159.176.226] (port=39206 helo=blaine.gmane.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpJXy-0007yR-9Q for emacs-devel@gnu.org; Wed, 28 Sep 2016 14:25:34 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bpJXr-0002t0-SD for emacs-devel@gnu.org; Wed, 28 Sep 2016 20:25:27 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 19 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:V9ymvVJh91OGX/Xky22oab/cBHU= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:207870 Archived-At: > This sounds crazy. Sorry about this ignorant question: Why do we use > this model of match data: a global state that is changed as a side > effect in thousands of circumstances. That's a design choice with which we've lived for ever. I don't like it either. I'd much rather have a regexp-matcher which returns the match data as a return *value*. I sometimes dream about extending pcase to support something like (pcase ((re "^\\(?header:[^:]*\\):\\(?value:.*\\)") (cons header value)) ...) of course, it would also take multiple branches and merge them into a single DFA, and in some versions it even brings world peace, Stefan