From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] sequence manipulation functions Date: Fri, 21 Nov 2014 09:44:10 -0500 Message-ID: References: <87oasmmwzt.fsf@gmail.com> <87bnolslph.fsf@gmail.com> <87zjc2dic0.fsf@gmail.com> <87ioimtzu0.fsf@gmail.com> <87lhngcnrc.fsf@gmail.com> <87k330cj3u.fsf@gmail.com> <87ioikcf39.fsf@gmail.com> <87h9y4c93e.fsf@gmail.com> <87y4r4wwtx.fsf@gmail.com> <87sihcwum5.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1416581198 11015 80.91.229.3 (21 Nov 2014 14:46:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Nov 2014 14:46:38 +0000 (UTC) Cc: Bozhidar Batsov , Emacs developers To: Nicolas Petton Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 21 15:46:30 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XrpTi-00087d-Oy for ged-emacs-devel@m.gmane.org; Fri, 21 Nov 2014 15:46:30 +0100 Original-Received: from localhost ([::1]:40911 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrpTh-0003jY-RA for ged-emacs-devel@m.gmane.org; Fri, 21 Nov 2014 09:46:29 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52309) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrpRe-0002e8-Th for emacs-devel@gnu.org; Fri, 21 Nov 2014 09:44:30 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XrpRX-00034l-Eu for emacs-devel@gnu.org; Fri, 21 Nov 2014 09:44:22 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:60572) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XrpRX-00034b-8r for emacs-devel@gnu.org; Fri, 21 Nov 2014 09:44:15 -0500 Original-Received: from pastel.home (lechon.iro.umontreal.ca [132.204.27.242]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id sALEiAgO018220; Fri, 21 Nov 2014 09:44:10 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7BFC343B8; Fri, 21 Nov 2014 09:44:10 -0500 (EST) In-Reply-To: <87sihcwum5.fsf@gmail.com> (Nicolas Petton's message of "Fri, 21 Nov 2014 14:28:34 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-NAI-Spam-Flag: NO X-NAI-Spam-Threshold: 5 X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV5132=0 X-NAI-Spam-Version: 2.3.0.9393 : core <5132> : inlines <1552> : streams <1346247> : uri <1835567> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 132.204.246.22 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:177945 Archived-At: >>> The macro could use to "dolist" if the sequence is a list. >> But you'd then duplicate the code of the body, which could be >> problematic, especially with nested seq-doseq loops. > Oh, right! Another way would be to use a function, but I tried to avoid > that. Do you have a better idea in mind? You can change your `i' to be either an integer (for arrays) or a cons cell (for lists). That requires an extra "is it a list?" test at each iteration of the loop (to know how to extract the element and to "increment" i), but I think it's the best we can do. Stefan