From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Alex Newsgroups: gmane.emacs.bugs Subject: bug#27177: 26.0.50: Macroexpanding cl-loop and friends (make-symbol usage) Date: Wed, 31 May 2017 20:02:30 -0600 Message-ID: <87lgpc79e1.fsf@gmail.com> References: <8737bk8vba.fsf@gmail.com> <87tw40y48h.fsf@drachen> <87shjk7doq.fsf@gmail.com> <87poeoy0zk.fsf@drachen> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1496282595 10842 195.159.176.226 (1 Jun 2017 02:03:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 1 Jun 2017 02:03:15 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) Cc: 27177@debbugs.gnu.org, npostavs@users.sourceforge.net To: Michael Heerdegen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jun 01 04:03:10 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 1dGFSA-0002X0-7Z for geb-bug-gnu-emacs@m.gmane.org; Thu, 01 Jun 2017 04:03:10 +0200 Original-Received: from localhost ([::1]:34887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGFSE-0002y9-5U for geb-bug-gnu-emacs@m.gmane.org; Wed, 31 May 2017 22:03:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58530) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dGFS8-0002y4-6W for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 22:03:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dGFS3-000151-AG for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 22:03:08 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:45535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dGFS3-00014x-65 for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 22:03:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dGFS2-0006Aj-JD for bug-gnu-emacs@gnu.org; Wed, 31 May 2017 22:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alex Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 01 Jun 2017 02:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27177 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27177-submit@debbugs.gnu.org id=B27177.149628256723700 (code B ref 27177); Thu, 01 Jun 2017 02:03:02 +0000 Original-Received: (at 27177) by debbugs.gnu.org; 1 Jun 2017 02:02:47 +0000 Original-Received: from localhost ([127.0.0.1]:48212 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGFRn-0006AB-1i for submit@debbugs.gnu.org; Wed, 31 May 2017 22:02:47 -0400 Original-Received: from mail-io0-f195.google.com ([209.85.223.195]:36550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dGFRl-00069y-B6 for 27177@debbugs.gnu.org; Wed, 31 May 2017 22:02:45 -0400 Original-Received: by mail-io0-f195.google.com with SMTP id f102so3500334ioi.3 for <27177@debbugs.gnu.org>; Wed, 31 May 2017 19:02:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=LFuyiZ9uigJv6q7NuopphPiTlG1CkwgLGHJe4K8MMuQ=; b=ZHVKzg5pWB5M01tmHZ+kz14v+AnWDYHi7GrU4uSjmLseQthqeQv9j/rz+Ue4HPNvn+ vzwc8oCWvshCgTFw4HNR82HG8O2dhLDUIR7TLY2MEmJHEOB10KpFIQoYMP1DJRs2lvFA mo0odDwWTExn3X5rUMPlALnnuU69GiH2jhScUooKdrRjJeAnl9NvUt+5uZO/HnCiu2tK h8yXap98wwK/bQp0+cYX6+QZ4lwXcGINjbzGi8spxFXq+mZErv2oK+z3sa+SeKCtBKaM Lo19zUkPmoAwoAGSSFrgCsWphqfNplPwK/OPz+TXjB95D/AG9UqdBYVy45axlHA6Lqq+ FDgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=LFuyiZ9uigJv6q7NuopphPiTlG1CkwgLGHJe4K8MMuQ=; b=XQfyxQhKin5Mkw8gEvBgS5ZtQtXNd3IudHHdqASN1K5BFdeKQdJ0y6lnIUcDsa/iBb JFGCgZbHGxyMKuwBvaMyRtcP5mdSL3B304fbQq04IzDjrBBI3jmEpihbM3/YkSnilbhf WAKnnxVBkPKEqrXLDcS7LQRUHkx3dF3YysaehSktGY5goO4/kHsAYyeyMIgPvLzTv4k2 9XQUXRSInWQcoE2neDrtmnJc7/WZF+/lZwg/SMTDEw8vBX+f+cv2b9prNsBll387lD+w SY6x8eQSyDvsyW32pHA+D5FHESOrbR47RKKfzpLzdTGvicggfpEoGuA88sKyfuD/19Ss XUtA== X-Gm-Message-State: AODbwcBgaU/6GZ5SG8kioUrhjLWDxbwwuaMVet/XnqvXSmmbWB09seQm mtCJbuEmsHMp1w== X-Received: by 10.107.35.75 with SMTP id j72mr24344386ioj.180.1496282559411; Wed, 31 May 2017 19:02:39 -0700 (PDT) Original-Received: from lylat (S010664777d9cebe3.ss.shawcable.net. [70.64.85.59]) by smtp.gmail.com with ESMTPSA id 67sm7639398ioc.27.2017.05.31.19.02.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 31 May 2017 19:02:38 -0700 (PDT) In-Reply-To: <87poeoy0zk.fsf@drachen> (Michael Heerdegen's message of "Thu, 01 Jun 2017 03:01:51 +0200") 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:133122 Archived-At: Michael Heerdegen writes: > With print-circle and print-gensym bound, I think the result does not > really read worse than how it would look like with with `cl-gensym' > generated code. That's much better, though I still think it could/should be better. For example, if you have multiple uninterned symbols with different symbol-names, they're all referenced by #number, and use the same counter. It also seems to make the output uglier as well. Consider: (macroexpand '(cl-loop for x in '(1 2 3) for y in '(a b c) repeat 10 repeat 20 collect (list x y))) Note the expressions using #5#. I suppose the 0 is being shared. It would also be nice if instead of many --cl-var-- variables, particular clauses would result in different symbol-names. For instance, if the `repeat' clause made a symbol called --cl-repeat--. This would further help readability. Also, using gensym could help 3rd-party packages. I usually use macrostep to expand macros and the value of print-circle has no effect on its expansions. macrostep individually prints out each uninterned symbol using prin1; can this approach be easily modified to get the same result as macroexpand? PS: The first line of the documentation of print-circle only mentions that it affects recursive structures. Perhaps it should mention the "shared substructures" part in the first line for emphasis?