From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: seq-mapn and circular lists Date: Thu, 15 Dec 2016 00:57:58 +0100 Message-ID: <874m26gj21.fsf@web.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1481759927 31960 195.159.176.226 (14 Dec 2016 23:58:47 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2016 23:58:47 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.90 (gnu/linux) Cc: "help-gnu-emacs@gnu.org" , Nicolas Petton , Plamen Tanovski To: John Mastro Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 15 00:58:37 2016 Return-path: Envelope-to: geh-help-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 1cHJRU-0006WP-Ol for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Dec 2016 00:58:36 +0100 Original-Received: from localhost ([::1]:50947 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHJRY-00067A-Nd for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2016 18:58:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHJR7-0005u6-HF for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 18:58:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHJR4-0000hX-G9 for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 18:58:13 -0500 Original-Received: from mout.web.de ([217.72.192.78]:59005) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cHJR4-0000ed-3t for help-gnu-emacs@gnu.org; Wed, 14 Dec 2016 18:58:10 -0500 Original-Received: from drachen.dragon ([2.206.2.48]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MNcV4-1cFdg22wkU-0079sT; Thu, 15 Dec 2016 00:58:00 +0100 In-Reply-To: (John Mastro's message of "Wed, 14 Dec 2016 15:32:44 -0800") X-Provags-ID: V03:K0:y/WAF51D7CfLCQeDTsr3wl3OFotX6+TtNZBHCcCvBQzsEAAsVql iloHs0N/JinHepFjsz0QFdpupKeZmK6VTSnvQYyZMiGWG4WmgvAxXaOignIOnqo1PitvDQM 66bU1MIoHTNh/u4uBvTj8JV/m5dO1p++HtjJSs490V23jIRRmKRpVfAjNawD1v/hznHD0km HJyejfT+eUqAzplV2hmGQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:0o2RSxH4T1E=:uTHsk8gMs6yi+XQsmh4EWl 1YrZmvQJHd+YUEJoDgOTYcREUsr8V5vVdSkp4SqlQGG9F6OX8P7KBNLqfstZSeBmh/a+FDrnb SYd0GcfHuL3lomjhKWI0ZSwih2tTVtu1QWouSdpneHP5CsXjp9erMPNntXTwGUayUxTLbb2sz Q3mpZz7iTT5ewMvDjQ6j4Tz3tDTFwogiiWj72QHdgwmRTU21aCpnA7ZiayrvZlHHDrR8QquvM HNrT+M+1jjMuS2O4fuwiMV1X71R7rrGUcTcFc2hWqaMmn0GAU/dy9LiDFCdGjVXPId2cj+KK+ A6tl5Zv0CyXnyCceNoCEZuGh8krrl6lxmz6siH4GuL0sVjfjR+QPQFLGhnds3zYmZuOJvcX9L z3MNZJ2+x2U3I36epVtNHsfv7dcKS+qHyCOvyCxnhUw1GdZ7+Uk2DXI3O5OX9nvz9Pg9uOQJl uBEkqccH+UvRoaT3fTsrc5FaL9LN9tjdQ4Odu0w23tOZTfuIWahPyoJ8HtMuGrS1knt132TqM 025OnblACHdrlKKcN9nVcVij1NiCYdl/ikTwgn4avKkVppbBHv01fva9qQq7HBVbRzHNEPKvc wL0hNqU/l+DzjWMl+pBup8o99xBP7iwSfjt3SKAvOpLcZfciymzJxj6cbd5PBGKBzXS/xGGjs vDdxrJJ6sHU9X5JWlGbkW9qdsrHboVOnMUIhJEDKuMLsr+hKR3DbTXzIjok256W+JiJfdpTiV 1lrqg7mvXDji/tu0FppEW1F2HpowF/lvXIFR50wgnUgHub/6dZFFm6cPRVrfs7MWKVFYYcdV X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 217.72.192.78 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:111958 Archived-At: John Mastro writes: [CC'ing the author of seq.el, Nicolas] > > while cl-map works fine on circular lists, seq-mapn just freezes > > > > (let ((l1 '#1=(1 . #1#))) > > ; (map 'list #'+ '(3 4 5 7) l1) > > (seq-mapn #'+ '(3 4 5 7) l1)) > > > > Making the circular list with setcdr or nconc doesn't help. Any > > suggestions? > Indeed, seq-map and seq-mapn do not attempt to identify or handle > circular lists. My advice would be to avoid circular lists, or stick > to `cl-map' if you must accommodate them :) The problem seems to be that `seq-mapn' transforms every argument sequence into a list before doing anything - but it doesn't check if anything is already a list, so it effectively copies any list argument, and this is what makes the thing freeze. If we avoid this copying, the function would already do the right thing. > Since seq.el is developed as part of Emacs, you can use `M-x > report-emacs-bug' to submit a feature request. Yes, please do that, Plamen. Michael.