From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#26338: 26.0.50; Collect all matches for REGEXP in current buffer Date: Sat, 08 Apr 2017 11:38:28 -0400 Message-ID: <87vaqeucy3.fsf@users.sourceforge.net> References: <8737dr6kxx.fsf@calancha-pc> <87h926cvgl.fsf@localhost> <87k272ow7g.fsf@calancha-pc> <87fuhpcbem.fsf@localhost> <87lgrheyvn.fsf@calancha-pc> <87pogsmefn.fsf@jane> <874ly3vw1p.fsf@users.sourceforge.net> <943bd0fd-c4ad-48f4-a803-f832b5bf0edf@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1491665893 9590 195.159.176.226 (8 Apr 2017 15:38:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 8 Apr 2017 15:38:13 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: 26338@debbugs.gnu.org, Tino Calancha , Marcin Borkowski , Juri Linkov To: Philipp Stephani Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Apr 08 17:38:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1cwsRA-0001Mo-D4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 17:38:04 +0200 Original-Received: from localhost ([::1]:55600 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwsRG-0005gD-DF for geb-bug-gnu-emacs@m.gmane.org; Sat, 08 Apr 2017 11:38:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34198) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cwsRB-0005g5-4l for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 11:38:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cwsR8-0007qu-1h for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 11:38:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:40080) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cwsR7-0007qo-TS for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 11:38:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cwsR7-0003e6-NW for bug-gnu-emacs@gnu.org; Sat, 08 Apr 2017 11:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 08 Apr 2017 15:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26338 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26338-submit@debbugs.gnu.org id=B26338.149166583213949 (code B ref 26338); Sat, 08 Apr 2017 15:38:01 +0000 Original-Received: (at 26338) by debbugs.gnu.org; 8 Apr 2017 15:37:12 +0000 Original-Received: from localhost ([127.0.0.1]:38279 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwsQK-0003ct-5K for submit@debbugs.gnu.org; Sat, 08 Apr 2017 11:37:12 -0400 Original-Received: from mail-io0-f194.google.com ([209.85.223.194]:33467) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cwsQH-0003cc-Jt for 26338@debbugs.gnu.org; Sat, 08 Apr 2017 11:37:10 -0400 Original-Received: by mail-io0-f194.google.com with SMTP id b140so5121703iof.0 for <26338@debbugs.gnu.org>; Sat, 08 Apr 2017 08:37:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=mtEkjZkpYaMcY07hu6RS/Yaaz0S6j93/CtsST9oM5Ik=; b=dDQCVfPWOFxSaVYrg8dIGa0mwcxxzBUiTiMP0LmJSDG16ibthFKl6NR60wT3sfL5Ed iOGwKEQ0mfG8Cg35lUmm4rhbjmwGH9MU6r61HjVyB5R2gDpsCV7vj0DPC3Zf2OaODBAI c7XEE5FBMWls7VNrxUwsXT8Ewg7J3CKsWyDuLQN3hHlcNFLssbNUMUMQNQhtOJSUVvMf sWbS08BoILSeXqeqyGhQMNCGZ/jzkXBHhh++sOBK4AEJ5EAWnBq/YW3QkHHBQ5oo2DxH aq5ppr9r7yAYKHqD67SlgNJuTcm5gI6ae+R6Z8rIif8/xsP+M7nm9guf9gTTg+4BkjbY g2mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=mtEkjZkpYaMcY07hu6RS/Yaaz0S6j93/CtsST9oM5Ik=; b=gSG6zpvUPuBotEQKmez/Vbe4l8FeQMjkmLpzIqFjgN7FzajIW1f/hHeVgEJ1Va0j6z Z9DPiik+mt6ISrN/UrLsT7pCKEVVKlsBgi8nxKhtj9BiaXITgZDGNdpDV7ifZTnmj5BD OOaRpKEXx9UgGmBaeQQUqT+1wGrunf2quBpcbLk0sE14/f61YzBQZIGOaAIcm0/XwHDe a+qpH1YbynJS7P2NW5vmWljNqNzrL3vPE87zjxWwqOsu0PIoVSmcoBlZDFzHKDVDRcKv xJHfiF3Hl4ijhntZDm5BcBtKsBNP41tQGXpXHUBiFJ40+86eEy4CsQmFfLdF5Fzt/qo8 42kg== X-Gm-Message-State: AN3rC/4mJQdVrOPyX3S8NzgWshFjvV0xfc64P0T3CznhbWNEjHHK8pe6xH1yLhzx/nQC8g== X-Received: by 10.107.188.194 with SMTP id m185mr9285776iof.137.1491665824037; Sat, 08 Apr 2017 08:37:04 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id e124sm1078933itb.24.2017.04.08.08.37.02 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 08 Apr 2017 08:37:03 -0700 (PDT) In-Reply-To: (Philipp Stephani's message of "Sat, 08 Apr 2017 14:41:29 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:131375 Archived-At: Philipp Stephani writes: >>> - Coupling of unrelated entities is always an antipattern. >>> - For N iterables and M looping constructs, you need to implement >>> N*M integrations. > > Yes, I don't care about Common Lisp. The iter-by clause is less of a > problem than 'buffers' etc. because it's not a one-off that couples a > looping construct with some random semantics. It's sort of related to Drew's concerns in that Emacs deals with the N*M problem by setting M=1, hence why only cl-loop gets the pressure to add more enhancments. There are some practical problem with iter-defun though: it has several bugs on which there doesn't seem to be any movement[1][2][3], it's reported to be slow[4], and cl-loop's iter-by keyword is not documented at all (that could be easily fixed, at least). I wonder if streams[5] is a better direction. It already has stream-regexp, though it returns match-data rather than a matched string. (package-install 'stream) (require 'stream) (require 'seq) (seq-do (lambda (m) (set-match-data m) (print (match-string 0))) (stream-regexp (current-buffer) (rx digit))) (cl-loop with matches = (stream-regexp (current-buffer) (rx digit)) for m = (stream-pop matches) while m do (set-match-data m) (print (match-string 0))) [1]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26073 [2]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25965 [3]: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=26068 [4]: http://lists.gnu.org/archive/html/emacs-devel/2017-03/msg00264.html [5]: https://elpa.gnu.org/packages/stream.html