From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Petton Newsgroups: gmane.emacs.devel Subject: Re: Would seq-range and seq-mapcat be useful? Date: Thu, 29 Jan 2015 23:06:50 +0100 Message-ID: <874mr9w8at.fsf@petton.fr> References: <878uglwmra.fsf@petton.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1422569243 8581 80.91.229.3 (29 Jan 2015 22:07:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Jan 2015 22:07:23 +0000 (UTC) Cc: Nicolas Petton , emacs-devel To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 29 23:07:21 2015 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 1YGxFB-0001T4-15 for ged-emacs-devel@m.gmane.org; Thu, 29 Jan 2015 23:07:21 +0100 Original-Received: from localhost ([::1]:33735 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGxFA-0000a9-ER for ged-emacs-devel@m.gmane.org; Thu, 29 Jan 2015 17:07:20 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGxEq-0000Qn-9M for emacs-devel@gnu.org; Thu, 29 Jan 2015 17:07:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YGxEi-0003Oc-Dp for emacs-devel@gnu.org; Thu, 29 Jan 2015 17:07:00 -0500 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:50072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YGxEi-0003OY-94 for emacs-devel@gnu.org; Thu, 29 Jan 2015 17:06:52 -0500 Original-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 270AB20856 for ; Thu, 29 Jan 2015 17:06:52 -0500 (EST) Original-Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Thu, 29 Jan 2015 17:06:52 -0500 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=x-sasl-enc:references:from:to:cc:subject :in-reply-to:date:message-id:mime-version:content-type; s= smtpout; bh=tlWtCY+nvnQ4zHlFueSUe59Bcok=; b=K2vximTafUzgrhjb7Ehd MLFzXNhD5AePmdW0aNyDtRrwqnKxXPkCRRoc4jP7xBBH7IReXFLNdQqhOS+AyGKB QRxjcSKAm7i5ZMAwyXiWBalyGYu/cZym8PJs26pZHxgTnI/BCEU25DreW7JOT5qK Z3pAymzgTNW6RntKt8JcdrM= X-Sasl-enc: n7sbg2zlbHd/3LAzJYxES3cGk2lsH761uQQORf2Bcx2A 1422569211 Original-Received: from blueberry (unknown [213.89.134.104]) by mail.messagingengine.com (Postfix) with ESMTPA id 529826800ED; Thu, 29 Jan 2015 17:06:51 -0500 (EST) User-agent: mu4e 0.9.9.6pre3; emacs 24.4.1 In-reply-to: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 66.111.4.27 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:182011 Archived-At: Stefan Monnier writes: > I have no idea what those names are supposed to evoke. Can you tell us > what they'd do? Sure, `seq-range' would be a convenient way to create a sequence of numbers. A simple implementation could be: (defun seq-range (start end) (let ((lst nil)) (while (< start end) (push end lst) (setq end (1- end))) lst)) `seq-mapcat' would apply `seq-concatenate' to the result of `seq-map': (defun seq-mapcat (function seq &optional type) (apply #'seq-concatenate (or type 'list) (seq-map function seq))) Cheers, Nico -- Nicolas Petton http://nicolas-petton.fr