From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:04:02 2022 Received: (at submit) by debbugs.gnu.org; 18 Sep 2022 12:04:02 +0000 Received: from localhost ([127.0.0.1]:48183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZt1l-0007Ru-P1 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:04:02 -0400 Received: from lists.gnu.org ([209.51.188.17]:55278) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZt1j-0007Re-8C for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:04:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39492) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZt1j-00071R-3y for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 08:03:59 -0400 Received: from mout02.posteo.de ([185.67.36.66]:57747) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oZt1f-0003Im-Nd for bug-gnu-emacs@gnu.org; Sun, 18 Sep 2022 08:03:58 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id C2023240103 for ; Sun, 18 Sep 2022 14:03:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663502633; bh=key6F6i/EzVg4ryS3W7dkc5yCoM0/z4Luo9Me4CjR6g=; h=From:To:Subject:Autocrypt:Date:From; b=nCdk9lJyTvfHa69IYkVCrKpLWeV+6/BzygJejoCtMOdsSMyiKPMvihFkM570rg0vb nIltrBbYb4rAfggt6lFqakHZOP2tmhmZd6uojRDGIu9kuWVbk4tcjnIjIsgLxp8Hq3 anU2oB2Aucud4aUVW5iojTW/dxL0wpw/0nAkPgNKMssO2/R6PsXfOXapUJF0edcKQ8 31QycFXeTXk39sWpQVz4ZUpNa7IdMKgQcQVs+eK8XW3KebiDNst8WcCGLoMfpl50QP wA62C8cuZhAH2QHV9nCRF2kFH5VOGpUJBW0SlbzaViaXpTeRT5JWDey7QFL1VmjVKK lji7QBJOM6GjQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVmgF0Blkz9rxM for ; Sun, 18 Sep 2022 14:03:51 +0200 (CEST) From: Philip Kaludercic To: bug-gnu-emacs@gnu.org Subject: 29.0.50; Using keywords with cl-loop Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 18 Sep 2022 12:03:50 +0000 Message-ID: <87tu54dh3t.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) In Common Lisp the following to are equivalent (loop :repeat 5 :collect t) and (loop repeat 5 collect t) as keywords are shared among all packages. In cl-lib, the former variant is now allowed, since :repeat is not recognised as a cl-loop keywords. It seems to me that it would be nice to support these too, as keywords have the superficial advantage of being a bit more readable due to their additional highlighting, and for some people it makes the macro a bit more comfortable to use since it doesn't have to feel like you are using a whole new language, but instead these are just keyword arguments to an unusual function call. In GNU Emacs 29.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.34, cairo version 1.17.6) of 2022-09-17 built on rhea Repository revision: bd77f60f949eab3453de76f130aa4a21ef9b1cc6 Repository branch: local System Description: Fedora Linux 36 (Workstation Edition) Configured using: 'configure --with-native-compilation --with-pgtk --with-imagemagick' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ IMAGEMAGICK JPEG JSON LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS XIM GTK3 ZLIB Important settings: value of $LANG: en_US.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: ELisp/l Minor modes in effect: rcirc-track-minor-mode: t global-git-commit-mode: t magit-auto-revert-mode: t auto-revert-mode: t shell-dirtrack-mode: t TeX-PDF-mode: t bug-reference-prog-mode: t outline-minor-mode: t flymake-mode: t yas-minor-mode: t flyspell-mode: t repeat-mode: t display-battery-mode: t display-time-mode: t diff-hl-flydiff-mode: t diff-hl-mode: t winner-mode: t windmove-mode: t corfu-history-mode: t corfu-mode: t vertico-multiform-mode: t vertico-mode: t electric-pair-mode: t recentf-mode: t save-place-mode: t savehist-mode: t pixel-scroll-precision-mode: t pixel-scroll-mode: t xterm-mouse-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t file-name-shadow-mode: t context-menu-mode: t global-font-lock-mode: t font-lock-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/philip/.config/emacs/site-lisp/ef-themes/ef-winter-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-winter-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-themes hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-themes /home/philip/.config/emacs/site-lisp/ef-themes/ef-summer-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-summer-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-spring-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-spring-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-night-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-night-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-light-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-light-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-duo-light-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-duo-light-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-duo-dark-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-duo-dark-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-deuteranopia-light-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-deuteranopia-light-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-deuteranopia-dark-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-deuteranopia-dark-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-day-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-day-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-dark-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-dark-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-autumn-theme hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-autumn-theme /home/philip/.config/emacs/site-lisp/ef-themes/ef-themes-autoloads hides /home/philip/.config/emacs/elpa/ef-themes-0.5.0/ef-themes-autoloads /home/philip/.config/emacs/elpa/transient-0.3.7/transient hides /home/philip/Source/emacs/lisp/transient /home/philip/.config/emacs/elpa/xref-1.5.1/xref hides /home/philip/Source/emacs/lisp/progmodes/xref Features: (shadow emacsbug man gnus-dup sp-tutor waffel doc-view image-mode exif ps-print ps-print-loaddefs lpr ox-odt rng-loc rng-uri rng-parse rng-match rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda org-refile ox-html table ox-ascii ox-publish ox org-element avl-tree hl-line rcirc nnagent nnml jka-compr tramp-sh display-line-numbers two-column eudc-capf eudc eudc-vars delsel rect flymake-cc help-at-pt mhtml-mode css-mode js cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs sgml-mode facemenu flow-fill nnselect gnus-search eieio-opt speedbar ezimage dframe make-mode embark tar-mode goto-addr timezone toolbar-x reporter desktop frameset context plain-tex latex latex-flymake tex-ispell tex-style compat-macs consult-icomplete icomplete forms forms-mode diff-hl-show-hunk diff-hl-inline-popup diff-hl-dired ef-winter-theme ef-summer-theme ef-spring-theme ef-night-theme ef-light-theme ef-duo-light-theme ef-duo-dark-theme ef-deuteranopia-light-theme ef-deuteranopia-dark-theme ef-day-theme ef-dark-theme ef-autumn-theme ef-themes python eglot array jsonrpc geiser-mode geiser-xref geiser-compile geiser-debug geiser-guile geiser-chibi info-look geiser geiser-repl geiser-image geiser-capf geiser-doc geiser-menu geiser-edit geiser-completion geiser-autodoc geiser-eval geiser-connection tq geiser-syntax scheme geiser-log geiser-popup view go-mode find-file ido git-rebase let-alist benchmark eww url-queue mm-url markdown-mode slime-repl-tests slime-tests inferior-slime slime-indentation slime-cl-indent cl-indent slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-autodoc slime-editing-commands slime-repl elp slime-parse grep slime gud apropos etags fileloop arc-mode archive-mode hyperspec which-key term ehelp eshell esh-cmd generator esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util cl org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete org-list org-faces org-entities org-version ob-emacs-lisp ob-core ob-eval org-table oc-basic bibtex ol org-keys oc org-compat org-macs org-loaddefs cal-menu calendar cal-loaddefs ert-x ert advice magit-patch magit-subtree magit-gitignore magit-ediff ediff ediff-merg ediff-mult ediff-wind ediff-diff ediff-help ediff-init ediff-util magit-extras face-remap magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff git-commit magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process with-editor server magit-mode transient edmacro magit-git magit-section magit-utils dash tabify debbugs-gnu debbugs-compat debbugs soap-client rng-xsd rng-dt rng-util xsd-regexp nndoc mm-archive url-http url-gw url-cache url-auth sh-script smie executable tramp-archive tramp-gvfs tramp-cache zeroconf tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat ls-lisp dictionary dictionary-connection ffap gnus-fun shell pcomplete shortdoc cus-edit cus-start cus-dep vertico-buffer finder avy log-edit consult-vertico consult compat-28 kmacro bookmark pp add-log vc-annotate mailalias smtpmail autocrypt-message ecomplete ietf-drums-date sort smiley gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check qp gnus-async gnus-bcklg gnus-ml disp-table autocrypt-gnus autocrypt nndraft nnmh utf-7 nnfolder epa-file network-stream nsm gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig nntp gnus-cache gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range message yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win char-fold misearch multi-isearch flymake-proselint xdg tex-info tex crm texmathp texinfo texinfo-loaddefs mule-util wombat-theme whiteboard-theme wheatgrass-theme tsdh-light-theme tango-theme tango-dark-theme modus-vivendi-theme misterioso-theme manoj-dark-theme light-blue-theme leuven-theme leuven-dark-theme dichromacy-theme deeper-blue-theme smerge-mode dired-aux gnus-dired copyright time-stamp pulse color xref cl-print edebug debug backtrace vc-backup vc-fossil vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs whitespace buffer-env compat bug-reference vc-git find-func tsdh-dark-theme vertico-directory orderless vertico-flat noutline outline checkdoc flymake-proc flymake yasnippet-snippets yasnippet flyspell ispell comp comp-cstr warnings icons cl-extra auth-source-pass repeat project format-spec battery dbus xml shell-command+ thingatpt dired-x dired dired-loaddefs rx time sendmail rfc2047 rfc2045 ietf-drums gnus nnheader gnus-util time-date mail-utils range mm-util mail-prsvr finder-inf diff-hl-flydiff diff diff-hl log-view pcvs-util vc-dir ewoc vc vc-dispatcher diff-mode easy-mmode hippie-exp winner windmove corfu-history corfu vertico-multiform vertico elec-pair recentf tree-widget wid-edit saveplace savehist pixel-scroll cua-base xt-mouse modus-operandi-theme modus-themes pcase cus-load setup site-lisp auto-site compile text-property-search comint ansi-color autoload loaddefs-gen lisp-mnt auctex-autoloads tex-site buffer-env-autoloads consult-autoloads compat-autoloads corfu-autoloads crdt-autoloads debbugs-autoloads diff-hl-autoloads ef-themes-autoloads embark-autoloads focus-autoloads geiser-chibi-autoloads geiser-guile-autoloads geiser-impl help-fns radix-tree help-mode geiser-custom geiser-base ring geiser-autoloads magit-autoloads slime-autoloads transient-autoloads vc-fossil-autoloads vertico-autoloads which-key-autoloads info xref-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile cconv url-vars cl-loaddefs cl-lib rmc iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 2923673 345540) (symbols 48 78147 110) (strings 32 419441 127926) (string-bytes 1 13928223) (vectors 16 217707) (vector-slots 8 4076811 237970) (floats 8 4366 992) (intervals 56 179610 6264) (buffers 1000 189)) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:20:35 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:20:35 +0000 Received: from localhost ([127.0.0.1]:48206 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtHm-0007xV-H0 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:20:34 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtHh-0007wx-KH for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:20:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=2mEB180pDf3RQ52cQvrCeiqYGdu5RVurgS2VUxwdDPQ=; b=c8FxOpaT5/kyYWvkY9+2cEtyZ0 LYKcDVDZcZcfyVmRU3UeGA1nVdHteEl9JG24SIDcrSqkMaptZc0rpVQ9Md9fypsqYOxfg/UK6Cq/k kgZ6XBRW+VIhW648Y8U+6C/L5f37nhLyI5bJqTgpOYIpk3QYf95BEikQAXpFh+LXVq10=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oZtHY-0007Z1-T4; Sun, 18 Sep 2022 14:20:23 +0200 From: Lars Ingebrigtsen To: Philip Kaludercic Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87tu54dh3t.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 18 Sep 2022 12:03:50 +0000") References: <87tu54dh3t.fsf@posteo.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEWsmGTGsXW7r5n5 +fnT0c6FdHA6MkL///+d0C9kAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YJEgwTBeNW4yMAAAGUSURB VDjLnZRLcsIwDIYdZtjHPQGYOutME/YZAqw7LvIBGKz7H6GS/MgD6KJaOBp//h3rtxJV6RQl0bXi 0PrQnUuMMgy1gLEDcAAW6HEDMNYNLBJgjLGWBuMkHbTOCgprLRjnSBzBBwME+LY+0D6SRsV+7Dyi R4sEHGLwULbyNOctj3fkNTNAQYrACoqBa9EmgQsP9wzo5fQOfAXKVtcFqAVw9F90JvN5Yk/arFhH O1f8A/TR9gL2YqKx0LBTVCBAiIr9wnY2DKKCgOPF1tPUhjxEKMclr5t7dhcQj1WynXIfmqnyNgPk dQRCSCBvxQDmCj0pFia20iUvwVxx4QpunIWi6LgXF14VsDZRvbuPd6D+Gxw69tXIfZy55V2bvo+e +xKv3NncomR7UvRcgb+C3Aei24miYsANe6H7UAyClVMpPfbZkkAXxYa28SOcvAp4m0CVQbMCegYw gnB8Bg9J34GkIHel8hMX8yOWRGB2ypiNUevQRmv1HKDiD4bMEX9mgKKuK1VJkmdhC1Ji+hFVOhO1 hV/qhvd9Tl5wdwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0xOFQxMjoxOTowNSswMDowMJrK 6TMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMThUMTI6MTk6MDUrMDA6MDDrl1GPAAAAAElF TkSuQmCC X-Now-Playing: The Meters's _Gettin' Funkier All The Time (5): Mister Moon_: "Find Yourself" Date: Sun, 18 Sep 2022 14:20:20 +0200 Message-ID: <87wna027sr.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philip Kaludercic writes: > It seems to me that it would be nice to support these too, as keywords > have the superficial advantage of being a bit more readable due to their > additional highlighting, and for some people it ma [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > It seems to me that it would be nice to support these too, as keywords > have the superficial advantage of being a bit more readable due to their > additional highlighting, and for some people it makes the macro a bit > more comfortable to use since it doesn't have to feel like you are using > a whole new language, but instead these are just keyword arguments to an > unusual function call. I think it'd just lead to even more confusion, since they aren't really keyword arguments. Because then you'd have to say (loop ... :do (progn (foo) (bar))) But you can say (loop ... do (foo) (bar)) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:27:03 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:27:03 +0000 Received: from localhost ([127.0.0.1]:48224 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtO0-00089Z-T8 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:27:03 -0400 Received: from mout02.posteo.de ([185.67.36.66]:36725) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtNx-00089I-MY for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:26:59 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id B49B7240105 for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 14:26:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663504011; bh=BPshzgyVtjWlAQNha+wQgYZZtxt2OI0VTbLqM216dko=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=sCM4xh+b/0fqJqEI2+BqJm7XN0+uNPwPaqLs1TH/XEGLxfvyY6ysnTqbyd1CDDmvA WmX4+/5NBQM1+4X+VNFsHP14TI88Oy7xalTqBSk6BRkFlxPxGXxAPNh0Du/Jl3H5mV jLzyt+dBK3w6iQAKIQ0rdX8zdPwWoQaDje8ewWgdks3BuktYc6+LkzU4lwV/BK6/eV +URYjSEpK6XZjzHE0hk4QDTjB1QtlhCAYe4320RUER73sfU/fLYCN92GLPk8xurDuc JBfyzEC65gA4hWNrjLL2O80V6Oxmm8r4MMpNPfpJq5ErwqwIFwZyNoadyX94EDjcWs gyyhuL6z+7HVQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVn9h25nzz9rxL; Sun, 18 Sep 2022 14:26:47 +0200 (CEST) From: Philip Kaludercic To: help-debbugs@gnu.org (GNU bug Tracking System) Subject: Re: bug#57907: Acknowledgement (29.0.50; Using keywords with cl-loop) In-Reply-To: (GNU bug Tracking System's message of "Sun, 18 Sep 2022 12:05:02 +0000") References: <87tu54dh3t.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 18 Sep 2022 12:26:46 +0000 Message-ID: <87pmfsdg1l.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain It seems it isn't that difficult to do this (though the patch is longer than it ought to be because of indentation changes): --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Have-cl-loop-handle-keyword-symbols.patch >From d98dc3e0905d41305061708a601d63659fa7ce81 Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 18 Sep 2022 14:25:29 +0200 Subject: [PATCH] Have 'cl-loop' handle keyword symbols * lisp/emacs-lisp/cl-macs.el (cl-loop): Add keywords to the edebug spec. (cl--parse-loop-clause): Handle keyword symbols by converting them into regular symbols. --- lisp/emacs-lisp/cl-macs.el | 938 +++++++++++++++++++------------------ 1 file changed, 474 insertions(+), 464 deletions(-) diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index f8fdc50251..2df91701e2 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -926,6 +926,9 @@ cl-loop do EXPRS... [finally] return EXPR +All cl-loop keywords may also be written using keyword +symbols (e.g. `:for' is the same as `for'). + For more details, see Info node `(cl)Loop Facility'. \(fn CLAUSE...)" @@ -933,22 +936,24 @@ cl-loop ;; These are usually followed by a symbol, but it can ;; actually be any destructuring-bind pattern, which ;; would erroneously match `form'. - [[&or "for" "as" "with" "and"] sexp] + [[&or "for" ":for" "as" ":as" "with" ":with" "and" ":and"] sexp] ;; These are followed by expressions which could ;; erroneously match `symbolp'. - [[&or "from" "upfrom" "downfrom" "to" "upto" "downto" - "above" "below" "by" "in" "on" "=" "across" - "repeat" "while" "until" "always" "never" - "thereis" "collect" "append" "nconc" "sum" - "count" "maximize" "minimize" - "if" "when" "unless" - "return"] + [[&or "from" ":from" "upfrom" ":upfrom" "downfrom" ":downfrom" "to" + ":to" "upto" ":upto" "downto" ":downto" "above" ":above" + "below" ":below" "by" ":by" "in" ":in" "on" ":on" "=" ":=" + "across" ":across" "repeat" ":repeat" "while" ":while" "until" + ":until" "always" ":always" "never" ":never" "thereis" + ":thereis" "collect" ":collect" "append" ":append" "nconc" + ":nconc" "sum" ":sum" "count" ":count" "maximize" ":maximize" + "minimize" ":minimize" "if" ":if" "when" ":when" "unless" + ":unless" "return" ":return" ] form] ["using" (symbolp symbolp)] ;; Simple default, which covers 99% of the cases. symbolp form))) (if (not (memq t (mapcar #'symbolp - (delq nil (delq t (cl-copy-list loop-args)))))) + (delq nil (remq t loop-args))))) `(cl-block nil (while t ,@loop-args)) (let ((cl--loop-args loop-args) (cl--loop-name nil) (cl--loop-bindings nil) (cl--loop-body nil) (cl--loop-steps nil) @@ -1184,465 +1189,470 @@ cl--push-clause-loop-body ;; '(&or (loop-d-type-spec . [&or nil loop-d-type-spec]) cl-type-spec)) (defun cl--parse-loop-clause () ; uses loop-* - (let ((word (pop cl--loop-args)) - (hash-types '(hash-key hash-keys hash-value hash-values)) - (key-types '(key-code key-codes key-seq key-seqs - key-binding key-bindings))) - (cond + (cl-flet ((next () + (let ((word (pop cl--loop-args))) + (if (keywordp word) + (intern (substring (symbol-name word) 1)) + word)))) + (let ((word (next)) + (hash-types '(hash-key hash-keys hash-value hash-values)) + (key-types '(key-code key-codes key-seq key-seqs + key-binding key-bindings))) + (cond + + ((null cl--loop-args) + (error "Malformed `cl-loop' macro")) + + ((eq word 'named) + (setq cl--loop-name (next))) + + ((eq word 'initially) + (if (memq (car cl--loop-args) '(do doing)) (next)) + (or (consp (car cl--loop-args)) + (error "Syntax error on `initially' clause")) + (while (consp (car cl--loop-args)) + (push (next) cl--loop-initially))) + + ((eq word 'finally) + (if (eq (car cl--loop-args) 'return) + (setq cl--loop-result-explicit + (or (cl--pop2 cl--loop-args) '(quote nil))) + (if (memq (car cl--loop-args) '(do doing)) (next)) + (or (consp (car cl--loop-args)) + (error "Syntax error on `finally' clause")) + (if (and (eq (caar cl--loop-args) 'return) (null cl--loop-name)) + (setq cl--loop-result-explicit + (or (nth 1 (next)) '(quote nil))) + (while (consp (car cl--loop-args)) + (push (next) cl--loop-finally))))) + + ((memq word '(for as)) + (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil) + (ands nil)) + (while + ;; Use `cl-gensym' rather than `make-symbol'. It's important that + ;; (not (eq (symbol-name var1) (symbol-name var2))) because + ;; these vars get added to the macro-environment. + (let ((var (or (next) (cl-gensym "--cl-var--")))) + (setq word (next)) + (if (eq word 'being) (setq word (next))) + (if (memq word '(the each)) (setq word (next))) + (if (memq word '(buffer buffers)) + (setq word 'in + cl--loop-args (cons '(buffer-list) cl--loop-args))) + (cond - ((null cl--loop-args) - (error "Malformed `cl-loop' macro")) - - ((eq word 'named) - (setq cl--loop-name (pop cl--loop-args))) - - ((eq word 'initially) - (if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args)) - (or (consp (car cl--loop-args)) - (error "Syntax error on `initially' clause")) - (while (consp (car cl--loop-args)) - (push (pop cl--loop-args) cl--loop-initially))) - - ((eq word 'finally) - (if (eq (car cl--loop-args) 'return) - (setq cl--loop-result-explicit - (or (cl--pop2 cl--loop-args) '(quote nil))) - (if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args)) - (or (consp (car cl--loop-args)) - (error "Syntax error on `finally' clause")) - (if (and (eq (caar cl--loop-args) 'return) (null cl--loop-name)) - (setq cl--loop-result-explicit - (or (nth 1 (pop cl--loop-args)) '(quote nil))) - (while (consp (car cl--loop-args)) - (push (pop cl--loop-args) cl--loop-finally))))) - - ((memq word '(for as)) - (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil) - (ands nil)) - (while - ;; Use `cl-gensym' rather than `make-symbol'. It's important that - ;; (not (eq (symbol-name var1) (symbol-name var2))) because - ;; these vars get added to the macro-environment. - (let ((var (or (pop cl--loop-args) (cl-gensym "--cl-var--")))) - (setq word (pop cl--loop-args)) - (if (eq word 'being) (setq word (pop cl--loop-args))) - (if (memq word '(the each)) (setq word (pop cl--loop-args))) - (if (memq word '(buffer buffers)) - (setq word 'in - cl--loop-args (cons '(buffer-list) cl--loop-args))) - (cond - - ((memq word '(from downfrom upfrom to downto upto - above below by)) - (push word cl--loop-args) - (if (memq (car cl--loop-args) '(downto above)) - (error "Must specify `from' value for downward cl-loop")) - (let* ((down (or (eq (car cl--loop-args) 'downfrom) - (memq (nth 2 cl--loop-args) - '(downto above)))) - (excl (or (memq (car cl--loop-args) '(above below)) - (memq (nth 2 cl--loop-args) - '(above below)))) - (start (and (memq (car cl--loop-args) - '(from upfrom downfrom)) - (cl--pop2 cl--loop-args))) - (end (and (memq (car cl--loop-args) - '(to upto downto above below)) - (cl--pop2 cl--loop-args))) - (step (and (eq (car cl--loop-args) 'by) - (cl--pop2 cl--loop-args))) - (end-var (and (not (macroexp-const-p end)) - (make-symbol "--cl-var--"))) - (step-var (and (not (macroexp-const-p step)) - (make-symbol "--cl-var--")))) - (and step (numberp step) (<= step 0) - (error "Loop `by' value is not positive: %s" step)) - (push (list var (or start 0)) loop-for-bindings) - (if end-var (push (list end-var end) loop-for-bindings)) - (if step-var (push (list step-var step) - loop-for-bindings)) - (when end + ((memq word '(from downfrom upfrom to downto upto + above below by)) + (push word cl--loop-args) + (if (memq (car cl--loop-args) '(downto above)) + (error "Must specify `from' value for downward cl-loop")) + (let* ((down (or (eq (car cl--loop-args) 'downfrom) + (memq (nth 2 cl--loop-args) + '(downto above)))) + (excl (or (memq (car cl--loop-args) '(above below)) + (memq (nth 2 cl--loop-args) + '(above below)))) + (start (and (memq (car cl--loop-args) + '(from upfrom downfrom)) + (cl--pop2 cl--loop-args))) + (end (and (memq (car cl--loop-args) + '(to upto downto above below)) + (cl--pop2 cl--loop-args))) + (step (and (eq (car cl--loop-args) 'by) + (cl--pop2 cl--loop-args))) + (end-var (and (not (macroexp-const-p end)) + (make-symbol "--cl-var--"))) + (step-var (and (not (macroexp-const-p step)) + (make-symbol "--cl-var--")))) + (and step (numberp step) (<= step 0) + (error "Loop `by' value is not positive: %s" step)) + (push (list var (or start 0)) loop-for-bindings) + (if end-var (push (list end-var end) loop-for-bindings)) + (if step-var (push (list step-var step) + loop-for-bindings)) + (when end + (cl--push-clause-loop-body + (list + (if down (if excl '> '>=) (if excl '< '<=)) + var (or end-var end)))) + (push (list var (list (if down '- '+) var + (or step-var step 1))) + loop-for-steps))) + + ((memq word '(in in-ref on)) + (let* ((on (eq word 'on)) + (temp (if (and on (symbolp var)) + var (make-symbol "--cl-var--")))) + (push (list temp (next)) loop-for-bindings) + (cl--push-clause-loop-body `(consp ,temp)) + (if (eq word 'in-ref) + (push (list var `(car ,temp)) cl--loop-symbol-macs) + (or (eq temp var) + (progn + (push (list var nil) loop-for-bindings) + (push (list var (if on temp `(car ,temp))) + loop-for-sets)))) + (push (list temp + (if (eq (car cl--loop-args) 'by) + (let ((step (cl--pop2 cl--loop-args))) + (if (and (memq (car-safe step) + '(quote function + cl-function)) + (symbolp (nth 1 step))) + (list (nth 1 step) temp) + `(funcall ,step ,temp))) + `(cdr ,temp))) + loop-for-steps))) + + ((eq word '=) + (let* ((start (next)) + (then (if (eq (car cl--loop-args) 'then) + (cl--pop2 cl--loop-args) start)) + (first-assign (or cl--loop-first-flag + (setq cl--loop-first-flag + (make-symbol "--cl-var--"))))) + (push (list var nil) loop-for-bindings) + (if (or ands (eq (car cl--loop-args) 'and)) + (progn + (push `(,var (if ,first-assign ,start ,var)) loop-for-sets) + (push `(,var (if ,(car (cl--loop-build-ands + (nreverse cl--loop-conditions))) + ,then ,var)) + loop-for-steps)) + (push (if (eq start then) + `(,var ,then) + `(,var (if ,first-assign ,start ,then))) + loop-for-sets)))) + + ((memq word '(across across-ref)) + (let ((temp-vec (make-symbol "--cl-vec--")) + (temp-idx (make-symbol "--cl-idx--"))) + (push (list temp-vec (next)) loop-for-bindings) + (push (list temp-idx -1) loop-for-bindings) + (push `(setq ,temp-idx (1+ ,temp-idx)) cl--loop-body) (cl--push-clause-loop-body - (list - (if down (if excl '> '>=) (if excl '< '<=)) - var (or end-var end)))) - (push (list var (list (if down '- '+) var - (or step-var step 1))) - loop-for-steps))) - - ((memq word '(in in-ref on)) - (let* ((on (eq word 'on)) - (temp (if (and on (symbolp var)) - var (make-symbol "--cl-var--")))) - (push (list temp (pop cl--loop-args)) loop-for-bindings) - (cl--push-clause-loop-body `(consp ,temp)) - (if (eq word 'in-ref) - (push (list var `(car ,temp)) cl--loop-symbol-macs) - (or (eq temp var) - (progn - (push (list var nil) loop-for-bindings) - (push (list var (if on temp `(car ,temp))) - loop-for-sets)))) - (push (list temp - (if (eq (car cl--loop-args) 'by) - (let ((step (cl--pop2 cl--loop-args))) - (if (and (memq (car-safe step) - '(quote function - cl-function)) - (symbolp (nth 1 step))) - (list (nth 1 step) temp) - `(funcall ,step ,temp))) - `(cdr ,temp))) - loop-for-steps))) - - ((eq word '=) - (let* ((start (pop cl--loop-args)) - (then (if (eq (car cl--loop-args) 'then) - (cl--pop2 cl--loop-args) start)) - (first-assign (or cl--loop-first-flag - (setq cl--loop-first-flag - (make-symbol "--cl-var--"))))) - (push (list var nil) loop-for-bindings) - (if (or ands (eq (car cl--loop-args) 'and)) - (progn - (push `(,var (if ,first-assign ,start ,var)) loop-for-sets) - (push `(,var (if ,(car (cl--loop-build-ands - (nreverse cl--loop-conditions))) - ,then ,var)) - loop-for-steps)) - (push (if (eq start then) - `(,var ,then) - `(,var (if ,first-assign ,start ,then))) - loop-for-sets)))) - - ((memq word '(across across-ref)) - (let ((temp-vec (make-symbol "--cl-vec--")) - (temp-idx (make-symbol "--cl-idx--"))) - (push (list temp-vec (pop cl--loop-args)) loop-for-bindings) - (push (list temp-idx -1) loop-for-bindings) - (push `(setq ,temp-idx (1+ ,temp-idx)) cl--loop-body) - (cl--push-clause-loop-body - `(< ,temp-idx (length ,temp-vec))) - (if (eq word 'across-ref) - (push (list var `(aref ,temp-vec ,temp-idx)) - cl--loop-symbol-macs) - (push (list var nil) loop-for-bindings) - (push (list var `(aref ,temp-vec ,temp-idx)) - loop-for-sets)))) - - ((memq word '(element elements)) - (let ((ref (or (memq (car cl--loop-args) '(in-ref of-ref)) - (and (not (memq (car cl--loop-args) '(in of))) - (error "Expected `of'")))) - (seq (cl--pop2 cl--loop-args)) - (temp-seq (make-symbol "--cl-seq--")) - (temp-idx - (if (eq (car cl--loop-args) 'using) - (if (and (= (length (cadr cl--loop-args)) 2) - (eq (caadr cl--loop-args) 'index)) - (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) - (make-symbol "--cl-idx--")))) - (push (list temp-seq seq) loop-for-bindings) - (push (list temp-idx 0) loop-for-bindings) - (if ref - (let ((temp-len (make-symbol "--cl-len--"))) - (push (list temp-len `(length ,temp-seq)) - loop-for-bindings) - (push (list var `(elt ,temp-seq ,temp-idx)) - cl--loop-symbol-macs) - (cl--push-clause-loop-body `(< ,temp-idx ,temp-len))) - (push (list var nil) loop-for-bindings) - (cl--push-clause-loop-body `(and ,temp-seq - (or (consp ,temp-seq) - (< ,temp-idx (length ,temp-seq))))) - (push (list var `(if (consp ,temp-seq) - (pop ,temp-seq) - (aref ,temp-seq ,temp-idx))) - loop-for-sets)) - (push (list temp-idx `(1+ ,temp-idx)) - loop-for-steps))) - - ((memq word hash-types) - (or (memq (car cl--loop-args) '(in of)) - (error "Expected `of'")) - (let* ((table (cl--pop2 cl--loop-args)) - (other - (if (eq (car cl--loop-args) 'using) - (if (and (= (length (cadr cl--loop-args)) 2) - (memq (caadr cl--loop-args) hash-types) - (not (eq (caadr cl--loop-args) word))) - (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) - (make-symbol "--cl-var--")))) - (if (memq word '(hash-value hash-values)) - (setq var (prog1 other (setq other var)))) - (cl--loop-set-iterator-function - 'hash-tables (lambda (body) - `(maphash (lambda (,var ,other) . ,body) - ,table))))) - - ((memq word '(symbol present-symbol external-symbol - symbols present-symbols external-symbols)) - (let ((ob (and (memq (car cl--loop-args) '(in of)) - (cl--pop2 cl--loop-args)))) - (cl--loop-set-iterator-function - 'symbols (lambda (body) - `(mapatoms (lambda (,var) . ,body) ,ob))))) - - ((memq word '(overlay overlays extent extents)) - (let ((buf nil) (from nil) (to nil)) - (while (memq (car cl--loop-args) '(in of from to)) - (cond ((eq (car cl--loop-args) 'from) - (setq from (cl--pop2 cl--loop-args))) - ((eq (car cl--loop-args) 'to) - (setq to (cl--pop2 cl--loop-args))) - (t (setq buf (cl--pop2 cl--loop-args))))) - (cl--loop-set-iterator-function - 'overlays (lambda (body) - `(cl--map-overlays - (lambda (,var ,(make-symbol "--cl-var--")) - (progn . ,body) nil) - ,buf ,from ,to))))) - - ((memq word '(interval intervals)) - (let ((buf nil) (prop nil) (from nil) (to nil) - (var1 (make-symbol "--cl-var1--")) - (var2 (make-symbol "--cl-var2--"))) - (while (memq (car cl--loop-args) '(in of property from to)) - (cond ((eq (car cl--loop-args) 'from) - (setq from (cl--pop2 cl--loop-args))) - ((eq (car cl--loop-args) 'to) - (setq to (cl--pop2 cl--loop-args))) - ((eq (car cl--loop-args) 'property) - (setq prop (cl--pop2 cl--loop-args))) - (t (setq buf (cl--pop2 cl--loop-args))))) - (if (and (consp var) (symbolp (car var)) (symbolp (cdr var))) - (setq var1 (car var) var2 (cdr var)) - (push (list var `(cons ,var1 ,var2)) loop-for-sets)) - (cl--loop-set-iterator-function - 'intervals (lambda (body) - `(cl--map-intervals - (lambda (,var1 ,var2) . ,body) - ,buf ,prop ,from ,to))))) - - ((memq word key-types) - (or (memq (car cl--loop-args) '(in of)) - (error "Expected `of'")) - (let ((cl-map (cl--pop2 cl--loop-args)) - (other - (if (eq (car cl--loop-args) 'using) - (if (and (= (length (cadr cl--loop-args)) 2) - (memq (caadr cl--loop-args) key-types) - (not (eq (caadr cl--loop-args) word))) - (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) - (make-symbol "--cl-var--")))) - (if (memq word '(key-binding key-bindings)) - (setq var (prog1 other (setq other var)))) - (cl--loop-set-iterator-function - 'keys (lambda (body) - `(,(if (memq word '(key-seq key-seqs)) - 'cl--map-keymap-recursively 'map-keymap) - (lambda (,var ,other) . ,body) ,cl-map))))) - - ((memq word '(frame frames screen screens)) - (let ((temp (make-symbol "--cl-var--"))) - (push (list var '(selected-frame)) - loop-for-bindings) - (push (list temp nil) loop-for-bindings) - (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) - (or ,temp (setq ,temp ,var)))) - (push (list var `(next-frame ,var)) - loop-for-steps))) - - ((memq word '(window windows)) - (let ((scr (and (memq (car cl--loop-args) '(in of)) - (cl--pop2 cl--loop-args))) - (temp (make-symbol "--cl-var--")) - (minip (make-symbol "--cl-minip--"))) - (push (list var (if scr - `(frame-selected-window ,scr) - '(selected-window))) - loop-for-bindings) - ;; If we started in the minibuffer, we need to - ;; ensure that next-window will bring us back there - ;; at some point. (Bug#7492). - ;; (Consider using walk-windows instead of cl-loop if - ;; you care about such things.) - (push (list minip `(minibufferp (window-buffer ,var))) - loop-for-bindings) - (push (list temp nil) loop-for-bindings) - (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) - (or ,temp (setq ,temp ,var)))) - (push (list var `(next-window ,var ,minip)) - loop-for-steps))) - - (t - ;; This is an advertised interface: (info "(cl)Other Clauses"). - (let ((handler (and (symbolp word) - (get word 'cl-loop-for-handler)))) - (if handler - (funcall handler var) - (error "Expected a `for' preposition, found %s" word))))) - (eq (car cl--loop-args) 'and)) - (setq ands t) - (pop cl--loop-args)) - (if (and ands loop-for-bindings) - (push (nreverse loop-for-bindings) cl--loop-bindings) - (setq cl--loop-bindings (nconc (mapcar #'list loop-for-bindings) - cl--loop-bindings))) - (if loop-for-sets - (push `(progn - ,(cl--loop-let (nreverse loop-for-sets) 'setq ands) + `(< ,temp-idx (length ,temp-vec))) + (if (eq word 'across-ref) + (push (list var `(aref ,temp-vec ,temp-idx)) + cl--loop-symbol-macs) + (push (list var nil) loop-for-bindings) + (push (list var `(aref ,temp-vec ,temp-idx)) + loop-for-sets)))) + + ((memq word '(element elements)) + (let ((ref (or (memq (car cl--loop-args) '(in-ref of-ref)) + (and (not (memq (car cl--loop-args) '(in of))) + (error "Expected `of'")))) + (seq (cl--pop2 cl--loop-args)) + (temp-seq (make-symbol "--cl-seq--")) + (temp-idx + (if (eq (car cl--loop-args) 'using) + (if (and (= (length (cadr cl--loop-args)) 2) + (eq (caadr cl--loop-args) 'index)) + (cadr (cl--pop2 cl--loop-args)) + (error "Bad `using' clause")) + (make-symbol "--cl-idx--")))) + (push (list temp-seq seq) loop-for-bindings) + (push (list temp-idx 0) loop-for-bindings) + (if ref + (let ((temp-len (make-symbol "--cl-len--"))) + (push (list temp-len `(length ,temp-seq)) + loop-for-bindings) + (push (list var `(elt ,temp-seq ,temp-idx)) + cl--loop-symbol-macs) + (cl--push-clause-loop-body `(< ,temp-idx ,temp-len))) + (push (list var nil) loop-for-bindings) + (cl--push-clause-loop-body `(and ,temp-seq + (or (consp ,temp-seq) + (< ,temp-idx (length ,temp-seq))))) + (push (list var `(if (consp ,temp-seq) + (pop ,temp-seq) + (aref ,temp-seq ,temp-idx))) + loop-for-sets)) + (push (list temp-idx `(1+ ,temp-idx)) + loop-for-steps))) + + ((memq word hash-types) + (or (memq (car cl--loop-args) '(in of)) + (error "Expected `of'")) + (let* ((table (cl--pop2 cl--loop-args)) + (other + (if (eq (car cl--loop-args) 'using) + (if (and (= (length (cadr cl--loop-args)) 2) + (memq (caadr cl--loop-args) hash-types) + (not (eq (caadr cl--loop-args) word))) + (cadr (cl--pop2 cl--loop-args)) + (error "Bad `using' clause")) + (make-symbol "--cl-var--")))) + (if (memq word '(hash-value hash-values)) + (setq var (prog1 other (setq other var)))) + (cl--loop-set-iterator-function + 'hash-tables (lambda (body) + `(maphash (lambda (,var ,other) . ,body) + ,table))))) + + ((memq word '(symbol present-symbol external-symbol + symbols present-symbols external-symbols)) + (let ((ob (and (memq (car cl--loop-args) '(in of)) + (cl--pop2 cl--loop-args)))) + (cl--loop-set-iterator-function + 'symbols (lambda (body) + `(mapatoms (lambda (,var) . ,body) ,ob))))) + + ((memq word '(overlay overlays extent extents)) + (let ((buf nil) (from nil) (to nil)) + (while (memq (car cl--loop-args) '(in of from to)) + (cond ((eq (car cl--loop-args) 'from) + (setq from (cl--pop2 cl--loop-args))) + ((eq (car cl--loop-args) 'to) + (setq to (cl--pop2 cl--loop-args))) + (t (setq buf (cl--pop2 cl--loop-args))))) + (cl--loop-set-iterator-function + 'overlays (lambda (body) + `(cl--map-overlays + (lambda (,var ,(make-symbol "--cl-var--")) + (progn . ,body) nil) + ,buf ,from ,to))))) + + ((memq word '(interval intervals)) + (let ((buf nil) (prop nil) (from nil) (to nil) + (var1 (make-symbol "--cl-var1--")) + (var2 (make-symbol "--cl-var2--"))) + (while (memq (car cl--loop-args) '(in of property from to)) + (cond ((eq (car cl--loop-args) 'from) + (setq from (cl--pop2 cl--loop-args))) + ((eq (car cl--loop-args) 'to) + (setq to (cl--pop2 cl--loop-args))) + ((eq (car cl--loop-args) 'property) + (setq prop (cl--pop2 cl--loop-args))) + (t (setq buf (cl--pop2 cl--loop-args))))) + (if (and (consp var) (symbolp (car var)) (symbolp (cdr var))) + (setq var1 (car var) var2 (cdr var)) + (push (list var `(cons ,var1 ,var2)) loop-for-sets)) + (cl--loop-set-iterator-function + 'intervals (lambda (body) + `(cl--map-intervals + (lambda (,var1 ,var2) . ,body) + ,buf ,prop ,from ,to))))) + + ((memq word key-types) + (or (memq (car cl--loop-args) '(in of)) + (error "Expected `of'")) + (let ((cl-map (cl--pop2 cl--loop-args)) + (other + (if (eq (car cl--loop-args) 'using) + (if (and (= (length (cadr cl--loop-args)) 2) + (memq (caadr cl--loop-args) key-types) + (not (eq (caadr cl--loop-args) word))) + (cadr (cl--pop2 cl--loop-args)) + (error "Bad `using' clause")) + (make-symbol "--cl-var--")))) + (if (memq word '(key-binding key-bindings)) + (setq var (prog1 other (setq other var)))) + (cl--loop-set-iterator-function + 'keys (lambda (body) + `(,(if (memq word '(key-seq key-seqs)) + 'cl--map-keymap-recursively 'map-keymap) + (lambda (,var ,other) . ,body) ,cl-map))))) + + ((memq word '(frame frames screen screens)) + (let ((temp (make-symbol "--cl-var--"))) + (push (list var '(selected-frame)) + loop-for-bindings) + (push (list temp nil) loop-for-bindings) + (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) + (or ,temp (setq ,temp ,var)))) + (push (list var `(next-frame ,var)) + loop-for-steps))) + + ((memq word '(window windows)) + (let ((scr (and (memq (car cl--loop-args) '(in of)) + (cl--pop2 cl--loop-args))) + (temp (make-symbol "--cl-var--")) + (minip (make-symbol "--cl-minip--"))) + (push (list var (if scr + `(frame-selected-window ,scr) + '(selected-window))) + loop-for-bindings) + ;; If we started in the minibuffer, we need to + ;; ensure that next-window will bring us back there + ;; at some point. (Bug#7492). + ;; (Consider using walk-windows instead of cl-loop if + ;; you care about such things.) + (push (list minip `(minibufferp (window-buffer ,var))) + loop-for-bindings) + (push (list temp nil) loop-for-bindings) + (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) + (or ,temp (setq ,temp ,var)))) + (push (list var `(next-window ,var ,minip)) + loop-for-steps))) + + (t + ;; This is an advertised interface: (info "(cl)Other Clauses"). + (let ((handler (and (symbolp word) + (get word 'cl-loop-for-handler)))) + (if handler + (funcall handler var) + (error "Expected a `for' preposition, found %s" word))))) + (eq (car cl--loop-args) 'and)) + (setq ands t) + (next)) + (if (and ands loop-for-bindings) + (push (nreverse loop-for-bindings) cl--loop-bindings) + (setq cl--loop-bindings (nconc (mapcar #'list loop-for-bindings) + cl--loop-bindings))) + (if loop-for-sets + (push `(progn + ,(cl--loop-let (nreverse loop-for-sets) 'setq ands) + t) + cl--loop-body)) + (when loop-for-steps + (push (cons (if ands 'cl-psetq 'setq) + (apply #'append (nreverse loop-for-steps))) + cl--loop-steps)))) + + ((eq word 'repeat) + (let ((temp (make-symbol "--cl-var--"))) + (push (list (list temp (next))) cl--loop-bindings) + (push `(>= (setq ,temp (1- ,temp)) 0) cl--loop-body))) + + ((memq word '(collect collecting)) + (let ((what (next)) + (var (cl--loop-handle-accum nil 'nreverse))) + (if (eq var cl--loop-accum-var) + (push `(progn (push ,what ,var) t) cl--loop-body) + (push `(progn + (setq ,var (nconc ,var (list ,what))) t) - cl--loop-body)) - (when loop-for-steps - (push (cons (if ands 'cl-psetq 'setq) - (apply #'append (nreverse loop-for-steps))) - cl--loop-steps)))) - - ((eq word 'repeat) - (let ((temp (make-symbol "--cl-var--"))) - (push (list (list temp (pop cl--loop-args))) cl--loop-bindings) - (push `(>= (setq ,temp (1- ,temp)) 0) cl--loop-body))) - - ((memq word '(collect collecting)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum nil 'nreverse))) - (if (eq var cl--loop-accum-var) - (push `(progn (push ,what ,var) t) cl--loop-body) - (push `(progn - (setq ,var (nconc ,var (list ,what))) + cl--loop-body)))) + + ((memq word '(nconc nconcing append appending)) + (let ((what (next)) + (var (cl--loop-handle-accum nil 'nreverse))) + (push `(progn + (setq ,var + ,(if (eq var cl--loop-accum-var) + `(nconc + (,(if (memq word '(nconc nconcing)) + #'nreverse #'reverse) + ,what) + ,var) + `(,(if (memq word '(nconc nconcing)) + #'nconc #'append) + ,var ,what))) t) - cl--loop-body)))) - - ((memq word '(nconc nconcing append appending)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum nil 'nreverse))) - (push `(progn - (setq ,var - ,(if (eq var cl--loop-accum-var) - `(nconc - (,(if (memq word '(nconc nconcing)) - #'nreverse #'reverse) - ,what) - ,var) - `(,(if (memq word '(nconc nconcing)) - #'nconc #'append) - ,var ,what))) - t) - cl--loop-body))) - - ((memq word '(concat concating)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum ""))) - (push `(progn (cl-callf concat ,var ,what) t) cl--loop-body))) - - ((memq word '(vconcat vconcating)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum []))) - (push `(progn (cl-callf vconcat ,var ,what) t) cl--loop-body))) - - ((memq word '(sum summing)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum 0))) - (push `(progn (cl-incf ,var ,what) t) cl--loop-body))) - - ((memq word '(count counting)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum 0))) - (push `(progn (if ,what (cl-incf ,var)) t) cl--loop-body))) - - ((memq word '(minimize minimizing maximize maximizing)) - (push `(progn ,(macroexp-let2 macroexp-copyable-p temp - (pop cl--loop-args) - (let* ((var (cl--loop-handle-accum nil)) - (func (intern (substring (symbol-name word) - 0 3)))) - `(setq ,var (if ,var (,func ,var ,temp) ,temp)))) - t) - cl--loop-body)) - - ((eq word 'with) - (let ((bindings nil)) - (while (progn (push (list (pop cl--loop-args) - (and (eq (car cl--loop-args) '=) - (cl--pop2 cl--loop-args))) - bindings) - (eq (car cl--loop-args) 'and)) - (pop cl--loop-args)) - (push (nreverse bindings) cl--loop-bindings))) - - ((eq word 'while) - (push (pop cl--loop-args) cl--loop-body)) - - ((eq word 'until) - (push `(not ,(pop cl--loop-args)) cl--loop-body)) - - ((eq word 'always) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) - (push `(setq ,cl--loop-finish-flag ,(pop cl--loop-args)) cl--loop-body) - (setq cl--loop-result t)) - - ((eq word 'never) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) - (push `(setq ,cl--loop-finish-flag (not ,(pop cl--loop-args))) - cl--loop-body) - (setq cl--loop-result t)) - - ((eq word 'thereis) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) - (or cl--loop-result-var - (setq cl--loop-result-var (make-symbol "--cl-var--"))) - (push `(setq ,cl--loop-finish-flag - (not (setq ,cl--loop-result-var ,(pop cl--loop-args)))) - cl--loop-body)) - - ((memq word '(if when unless)) - (let* ((cond (pop cl--loop-args)) - (then (let ((cl--loop-body nil)) - (cl--parse-loop-clause) - (cl--loop-build-ands (nreverse cl--loop-body)))) - (else (let ((cl--loop-body nil)) - (if (eq (car cl--loop-args) 'else) - (progn (pop cl--loop-args) (cl--parse-loop-clause))) - (cl--loop-build-ands (nreverse cl--loop-body)))) - (simple (and (eq (car then) t) (eq (car else) t)))) - (if (eq (car cl--loop-args) 'end) (pop cl--loop-args)) - (if (eq word 'unless) (setq then (prog1 else (setq else then)))) - (let ((form (cons (if simple (cons 'progn (nth 1 then)) (nth 2 then)) - (if simple (nth 1 else) (list (nth 2 else)))))) - (setq form (if (cl--expr-contains form 'it) - `(let ((it ,cond)) (if it ,@form)) - `(if ,cond ,@form))) - (push (if simple `(progn ,form t) form) cl--loop-body)))) - - ((memq word '(do doing)) - (let ((body nil)) - (or (consp (car cl--loop-args)) (error "Syntax error on `do' clause")) - (while (consp (car cl--loop-args)) (push (pop cl--loop-args) body)) - (push (cons 'progn (nreverse (cons t body))) cl--loop-body))) - - ((eq word 'return) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-var--"))) - (or cl--loop-result-var - (setq cl--loop-result-var (make-symbol "--cl-var--"))) - (push `(setq ,cl--loop-result-var ,(pop cl--loop-args) - ,cl--loop-finish-flag nil) - cl--loop-body)) - - (t - ;; This is an advertised interface: (info "(cl)Other Clauses"). - (let ((handler (and (symbolp word) (get word 'cl-loop-handler)))) - (or handler (error "Expected a cl-loop keyword, found %s" word)) - (funcall handler)))) - (if (eq (car cl--loop-args) 'and) - (progn (pop cl--loop-args) (cl--parse-loop-clause))))) + cl--loop-body))) + + ((memq word '(concat concating)) + (let ((what (next)) + (var (cl--loop-handle-accum ""))) + (push `(progn (cl-callf concat ,var ,what) t) cl--loop-body))) + + ((memq word '(vconcat vconcating)) + (let ((what (next)) + (var (cl--loop-handle-accum []))) + (push `(progn (cl-callf vconcat ,var ,what) t) cl--loop-body))) + + ((memq word '(sum summing)) + (let ((what (next)) + (var (cl--loop-handle-accum 0))) + (push `(progn (cl-incf ,var ,what) t) cl--loop-body))) + + ((memq word '(count counting)) + (let ((what (next)) + (var (cl--loop-handle-accum 0))) + (push `(progn (if ,what (cl-incf ,var)) t) cl--loop-body))) + + ((memq word '(minimize minimizing maximize maximizing)) + (push `(progn ,(macroexp-let2 macroexp-copyable-p temp + (next) + (let* ((var (cl--loop-handle-accum nil)) + (func (intern (substring (symbol-name word) + 0 3)))) + `(setq ,var (if ,var (,func ,var ,temp) ,temp)))) + t) + cl--loop-body)) + + ((eq word 'with) + (let ((bindings nil)) + (while (progn (push (list (next) + (and (eq (car cl--loop-args) '=) + (cl--pop2 cl--loop-args))) + bindings) + (eq (car cl--loop-args) 'and)) + (next)) + (push (nreverse bindings) cl--loop-bindings))) + + ((eq word 'while) + (push (next) cl--loop-body)) + + ((eq word 'until) + (push `(not ,(next)) cl--loop-body)) + + ((eq word 'always) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) + (push `(setq ,cl--loop-finish-flag ,(next)) cl--loop-body) + (setq cl--loop-result t)) + + ((eq word 'never) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) + (push `(setq ,cl--loop-finish-flag (not ,(next))) + cl--loop-body) + (setq cl--loop-result t)) + + ((eq word 'thereis) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) + (or cl--loop-result-var + (setq cl--loop-result-var (make-symbol "--cl-var--"))) + (push `(setq ,cl--loop-finish-flag + (not (setq ,cl--loop-result-var ,(next)))) + cl--loop-body)) + + ((memq word '(if when unless)) + (let* ((cond (next)) + (then (let ((cl--loop-body nil)) + (cl--parse-loop-clause) + (cl--loop-build-ands (nreverse cl--loop-body)))) + (else (let ((cl--loop-body nil)) + (if (eq (car cl--loop-args) 'else) + (progn (next) (cl--parse-loop-clause))) + (cl--loop-build-ands (nreverse cl--loop-body)))) + (simple (and (eq (car then) t) (eq (car else) t)))) + (if (eq (car cl--loop-args) 'end) (next)) + (if (eq word 'unless) (setq then (prog1 else (setq else then)))) + (let ((form (cons (if simple (cons 'progn (nth 1 then)) (nth 2 then)) + (if simple (nth 1 else) (list (nth 2 else)))))) + (setq form (if (cl--expr-contains form 'it) + `(let ((it ,cond)) (if it ,@form)) + `(if ,cond ,@form))) + (push (if simple `(progn ,form t) form) cl--loop-body)))) + + ((memq word '(do doing)) + (let ((body nil)) + (or (consp (car cl--loop-args)) (error "Syntax error on `do' clause")) + (while (consp (car cl--loop-args)) (push (next) body)) + (push (cons 'progn (nreverse (cons t body))) cl--loop-body))) + + ((eq word 'return) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-var--"))) + (or cl--loop-result-var + (setq cl--loop-result-var (make-symbol "--cl-var--"))) + (push `(setq ,cl--loop-result-var ,(next) + ,cl--loop-finish-flag nil) + cl--loop-body)) + + (t + ;; This is an advertised interface: (info "(cl)Other Clauses"). + (let ((handler (and (symbolp word) (get word 'cl-loop-handler)))) + (or handler (error "Expected a cl-loop keyword, found %s" word)) + (funcall handler)))) + (if (eq (car cl--loop-args) 'and) + (progn (next) (cl--parse-loop-clause)))))) (defun cl--unused-var-p (sym) (or (null sym) (eq ?_ (aref (symbol-name sym) 0)))) -- 2.37.3 --=-=-= Content-Type: text/plain Perhaps I could pull the cl-flet out and replace each (next) with a (cl--loop-parse-next)? --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:28:27 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:28:27 +0000 Received: from localhost ([127.0.0.1]:48229 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtPP-0008CW-BZ for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:28:27 -0400 Received: from mout01.posteo.de ([185.67.36.65]:58549) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtPN-0008CH-Cq for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:28:25 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DC759240026 for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 14:28:19 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663504099; bh=SHoyxhj5IGhVLq99HOnFsX7Clcd1LCWH3LqK1wwrLKw=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=oT+WbugCggLSV4ZuXkbqyRZR7VBQ2S/qpKhUFMrKb6a1XgpyXeYJzc9EaOAeTFHmc jLE107YzQukBHkeGhmm58+LySbKhEdK0DiRwReNVsUTLGKxZtQMjbi/YEwVLjcfGeR NmSs9h9Zj+2dTFfD1g7HI0iI5RP/ggjuWezMglcwTRR1IcJJ90puBzMTs02PERbi9s cGoVqxSD5OFmNseCN6hXUJ/qhIPpkbKiCeHcDrzmAfW8h04tcaDLHZbzUaL3dPV0aI Wwl8h05dxDOrkVtYgSVljxG81Nx28SkzSz+0D7oGArT0VdGW6q4JGJogXH06dIMi6m HmMzAHCLjQztQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVnCR1BsRz9rxP; Sun, 18 Sep 2022 14:28:19 +0200 (CEST) From: Philip Kaludercic To: Lars Ingebrigtsen Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87wna027sr.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 18 Sep 2022 14:20:20 +0200") References: <87tu54dh3t.fsf@posteo.net> <87wna027sr.fsf@gnus.org> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 18 Sep 2022 12:28:18 +0000 Message-ID: <87leqgdfz1.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >> It seems to me that it would be nice to support these too, as keywords >> have the superficial advantage of being a bit more readable due to their >> additional highlighting, and for some people it makes the macro a bit >> more comfortable to use since it doesn't have to feel like you are using >> a whole new language, but instead these are just keyword arguments to an >> unusual function call. > > I think it'd just lead to even more confusion, since they aren't really > keyword arguments. Because then you'd have to say > > (loop ... > :do (progn (foo) (bar))) > > But you can say > > (loop ... > do (foo) > (bar)) Why would this be necessary? I am not saying that `cl-loop' should be converted into a proper keyword-macro, just that each `:foo' in a loop-keyword position ought to be interpreted as `foo'. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:37:46 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:37:46 +0000 Received: from localhost ([127.0.0.1]:48239 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtYP-0008UZ-Qv for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:37:46 -0400 Received: from quimby.gnus.org ([95.216.78.240]:38904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtYN-0008UH-Cp for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:37:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=WxQWCtFpfqAsMSCxRk4iw5ZlAtfPnS1ChjWHle1s7kg=; b=WkV34qMxYuiQc+zvqYqSlcgJXD aUldgCNy4ywS2pCLWx+Iu6zqvdF6Se+eMcEfuaDPbNsPaTDRscbACDucxdxr6e20t+cLhDB64GFSy nfAdUGqjjGOKDVwej0g3yL14Erimv/4DEdfsSkWq9weNc6/PsbGOA87IG/FBccqeTu0I=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oZtYE-0007cv-GP; Sun, 18 Sep 2022 14:37:36 +0200 From: Lars Ingebrigtsen To: Philip Kaludercic Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87leqgdfz1.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 18 Sep 2022 12:28:18 +0000") References: <87tu54dh3t.fsf@posteo.net> <87wna027sr.fsf@gnus.org> <87leqgdfz1.fsf@posteo.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAGFBMVEWsmGTGsXW7r5n5 +fnT0c6FdHA6MkL///+d0C9kAAAAAWJLR0QHFmGI6wAAAAd0SU1FB+YJEgwTBeNW4yMAAAGUSURB VDjLnZRLcsIwDIYdZtjHPQGYOutME/YZAqw7LvIBGKz7H6GS/MgD6KJaOBp//h3rtxJV6RQl0bXi 0PrQnUuMMgy1gLEDcAAW6HEDMNYNLBJgjLGWBuMkHbTOCgprLRjnSBzBBwME+LY+0D6SRsV+7Dyi R4sEHGLwULbyNOctj3fkNTNAQYrACoqBa9EmgQsP9wzo5fQOfAXKVtcFqAVw9F90JvN5Yk/arFhH O1f8A/TR9gL2YqKx0LBTVCBAiIr9wnY2DKKCgOPF1tPUhjxEKMclr5t7dhcQj1WynXIfmqnyNgPk dQRCSCBvxQDmCj0pFia20iUvwVxx4QpunIWi6LgXF14VsDZRvbuPd6D+Gxw69tXIfZy55V2bvo+e +xKv3NncomR7UvRcgb+C3Aei24miYsANe6H7UAyClVMpPfbZkkAXxYa28SOcvAp4m0CVQbMCegYw gnB8Bg9J34GkIHel8hMX8yOWRGB2ypiNUevQRmv1HKDiD4bMEX9mgKKuK1VJkmdhC1Ji+hFVOhO1 hV/qhvd9Tl5wdwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0xOFQxMjoxOTowNSswMDowMJrK 6TMAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMThUMTI6MTk6MDUrMDA6MDDrl1GPAAAAAElF TkSuQmCC X-Now-Playing: The Meters's _Gettin' Funkier All The Time (5): Mister Moon_: "Suite For 20 G" Date: Sun, 18 Sep 2022 14:37:33 +0200 Message-ID: <87sfko2702.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philip Kaludercic writes: > Why would this be necessary? I am not saying that `cl-loop' should be > converted into a proper keyword-macro, just that each `:foo' in a > loop-keyword position ought to be interpreted as `foo'. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > Why would this be necessary? I am not saying that `cl-loop' should be > converted into a proper keyword-macro, just that each `:foo' in a > loop-keyword position ought to be interpreted as `foo'. You said that cl-loop would be more comfortable if "it doesn't have to feel like you are using a whole new language, but instead these are just keyword arguments to an unusual function call". I'm pointing out that this is wrong -- they are not keyword arguments, and if you think that they are, you're going to be using it wrong. In other words, it is a whole new language, not just keyword arguments. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:38:46 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:38:46 +0000 Received: from localhost ([127.0.0.1]:48244 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtZO-00004r-8d for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:38:46 -0400 Received: from mail-ej1-f49.google.com ([209.85.218.49]:35790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtZL-0008WF-CO for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:38:45 -0400 Received: by mail-ej1-f49.google.com with SMTP id go34so58756063ejc.2 for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 05:38:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id:from:to:cc :subject:date; bh=4HkywSOs4HTzyPxIOP1v+X+JkSpCycvWTNPZgen5i8o=; b=Q/UxQQvc3xG1DQZmpIOoToEmQtq/9m+ll8tFm/Xg9gd7RdKj9dVcUBx0JkZrTuayec JKPGTa24idH/VbTMKQOTGixFCx5cG5jIBQC1sZ/n/mYKoVfALTEqvXPfQupCurnA5Rkj oC2r5okt4jstuYSGclDl8lnHmKA9/qT0IT4AS8SN8zxsbaKai5D7HKNQdr8egpYwoIup opt2fo+QF0VQm9obbPWilj2QlEgh9B9WVsY4DRprazm7wR9bJ5+TQQv4jvKRMtFqN8Mm 9XRXUKADuOWRxYeKD65qcUpNnSnzkwNQRywbK8sx1IqGnnFItgGfRv/QxMA4A0+v5SU/ 8rwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:from:content-language :references:cc:to:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=4HkywSOs4HTzyPxIOP1v+X+JkSpCycvWTNPZgen5i8o=; b=byBfXnI0rJS7SG+05sGe1ypHM9oIqxXCNHGFZ67/h8eTvH6EVL3KoPMv/HTF6M2EwF 3ut3hon/FbD831jHrd3NKqWJyzWUTjVCnW6piV/WrJDKbgV8lg+JbKp+pm+D/uhK7vsR J0WnSqEcaT0xy5sam0Rxxc3HWoHYzGabOzRK/LtNAT+ONb1OUD5SUcfIF4lmMzkuO9QY KOLO4qS1RB0UVdjCZAUyGN/cc8tKsEhj+uyw7+zDT5QaUxrz9COf6oCHvBsSgBXa/wAy gftP74e/bPPL7OgAVwxRMS2MRVnv32vzHnDOiS6OfxHhW27PCEnKFydKcd8AZx/jbLDk Txag== X-Gm-Message-State: ACrzQf3O1BJttn4Ds+TpW95PhqEFQ5xDy5hxuZGMRyzErolEyJfijMTu tsB/Uh2LjVFLd8DHrz3gg8U= X-Google-Smtp-Source: AMsMyM4pltNcyIF6mIbF4nZsagFl2uxtKUAvPzMbRHcg2WPtha4c8xYDhhL+gaERQfeypp6Ij67OFg== X-Received: by 2002:a17:907:1690:b0:77c:37be:2345 with SMTP id hc16-20020a170907169000b0077c37be2345mr9413585ejc.359.1663504717586; Sun, 18 Sep 2022 05:38:37 -0700 (PDT) Received: from [192.168.178.21] (pd9e3614c.dip0.t-ipconnect.de. [217.227.97.76]) by smtp.gmail.com with ESMTPSA id p8-20020aa7d308000000b00443d657d8a4sm17570327edq.61.2022.09.18.05.38.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 18 Sep 2022 05:38:36 -0700 (PDT) Message-ID: Date: Sun, 18 Sep 2022 14:38:36 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 To: philipk@posteo.net References: <87tu54dh3t.fsf@posteo.net> Content-Language: en-US From: =?UTF-8?Q?Gerd_M=c3=b6llmann?= Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87tu54dh3t.fsf@posteo.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -1.8 (-) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.8 (--) From: Philip Kaludercic @ 2022-09-18 12:03 UTC (permalink / raw) To: 57907 > In Common Lisp the following to are equivalent > > (loop :repeat 5 :collect t) > > and > > (loop repeat 5 collect t) > > as keywords are shared among all packages. Actually, that's not the reason why Common Lisp accepts that. The reason is that the loop macro only looks at symbol names. In Common Lisp (symbol-name :a) => "A" (symbol-package :a) => # (symbol-name foo:a) => "A" (symbol-package foo:a) => # while in Emacs (symbol-name :a) => ":a" Wouldn't it be nice if Emacs finally decided to have Common Lisp packages? From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:46:32 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:46:32 +0000 Received: from localhost ([127.0.0.1]:48288 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtgt-0000MW-TW for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:46:32 -0400 Received: from mout02.posteo.de ([185.67.36.66]:50913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtgs-0000MC-4B for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:46:31 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id E1486240101 for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 14:46:21 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663505183; bh=89rh7TN4IqGA6WHEqQsK0AUw7464NV7IVg4DBKGDljI=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=cKJuWjWbn48smug9aexx3HRtjf9mWI93haRmI0205w8Gj+mnuvJzUL2xg2QWInooW b9HXWt3o8bNxEf9BaD84T1xygE4oZ0M9f2X1wtlYs/dqDDOIncAXVhOodahDrwRpX7 Dj6ywGKXJUQ14uPegSIPTbt9J5+U1A8TjL1XIgh1bmrvz/45sfF307z5GB8xZXWa46 OVs6Y7B+Qk/U2UCaTqGFkbqfSpPL2cHecUVJr4bZJrKv8NFH/uL4PgIKujKxar2jaH kYr97RplEG9mgbelenntOsG3fgyqGIDfRz7kGRkjCNThsy1t39FF7GgXaC+H1DMucn 2uHel2TtjQVcQ== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVncD3Flmz6tmG; Sun, 18 Sep 2022 14:46:19 +0200 (CEST) From: Philip Kaludercic To: Lars Ingebrigtsen Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87sfko2702.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sun, 18 Sep 2022 14:37:33 +0200") References: <87tu54dh3t.fsf@posteo.net> <87wna027sr.fsf@gnus.org> <87leqgdfz1.fsf@posteo.net> <87sfko2702.fsf@gnus.org> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 18 Sep 2022 12:46:18 +0000 Message-ID: <874jx46eat.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >> Why would this be necessary? I am not saying that `cl-loop' should be >> converted into a proper keyword-macro, just that each `:foo' in a >> loop-keyword position ought to be interpreted as `foo'. > > You said that cl-loop would be more comfortable if "it doesn't have to > feel like you are using a whole new language, but instead these are > just keyword arguments to an unusual function call". > > I'm pointing out that this is wrong -- they are not keyword arguments, > and if you think that they are, you're going to be using it wrong. > > In other words, it is a whole new language, not just keyword arguments. I phrased that clumsily -- while it is a new language, it doesn't always have to feel like one. E.g. the repeat-collect example I gave before. If you *can* use keywords, you *can* make some cl-loop invocations appear to be a macro or a function call with keyword-arguments. But of course this wouldn't be the case, as the macro should stay backwards compatible. From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 08:52:25 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 12:52:25 +0000 Received: from localhost ([127.0.0.1]:48307 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtma-0000Z3-Ox for submit@debbugs.gnu.org; Sun, 18 Sep 2022 08:52:25 -0400 Received: from mout01.posteo.de ([185.67.36.65]:40737) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtmY-0000Ye-Ju for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 08:52:23 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 1D00D240028 for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 14:52:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663505537; bh=J0WzhqsikY8U/UNuRoJJYyi0IhPyMqbq6lsJyjFwPiY=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=myL9P59f1QIDhuFFTDIqPj1s6/8J61dLRHNpsKHvKK8pPFYDofyOq0PGm3opPX3r+ KAlonklM5n6ClW81qRQfmAub5vj6ZwwYPXOdpTP3ye7xFnZ99ceIQ2JARVz3QbtsW4 eQte8yaT66r3c+jwh5OP6iAAXRVSw7qXH0toNB6AzY2NyxGjTTMhkDUufXAdmRMKqO Pdnh8KhExyRO9D4jKpSrd/75bu6hMJy70OOW4Ys7s3al+5qZbIpQ61axnkiE0cEjFt TJ7dQiSQ9F6VdpifLHGgy9jt4D55C9jsXxNFYKzDd1qmawuWP+LkhExeGX6PlZHrXf qmgpdfw1F3xjg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVnl451Kfz6tmM; Sun, 18 Sep 2022 14:52:14 +0200 (CEST) From: Philip Kaludercic To: Gerd =?utf-8?Q?M=C3=B6llmann?= Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: ("Gerd =?utf-8?Q?M=C3=B6llmann=22's?= message of "Sun, 18 Sep 2022 14:38:36 +0200") References: <87tu54dh3t.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 18 Sep 2022 12:52:14 +0000 Message-ID: <87mtaw4zgh.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Gerd M=C3=B6llmann writes: > From: Philip Kaludercic @ 2022-09-18 12:03 UTC (permalink / raw) > To: 57907 > > >> In Common Lisp the following to are equivalent >> >> (loop :repeat 5 :collect t) >> >> and >> >> (loop repeat 5 collect t) >> >> as keywords are shared among all packages. > > Actually, that's not the reason why Common Lisp accepts that. The > reason is that the loop macro only looks at symbol names. In Common > Lisp > > (symbol-name :a) =3D> "A" > (symbol-package :a) =3D> # > (symbol-name foo:a) =3D> "A" > (symbol-package foo:a) =3D> # Interesting, I did not know this. But the point remains that Common Lisp's loop accepts both the symbol "a" from the "COMMON-LISP" package and from the "KEYWORD" package, right? > while in Emacs > > (symbol-name :a) =3D> ":a" > > Wouldn't it be nice if Emacs finally decided to have Common Lisp packages? Yeah, if only we could convince Emacs to do that ;) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 09:01:19 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 13:01:19 +0000 Received: from localhost ([127.0.0.1]:48333 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtvD-0000rS-7n for submit@debbugs.gnu.org; Sun, 18 Sep 2022 09:01:19 -0400 Received: from mail-ed1-f42.google.com ([209.85.208.42]:36614) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oZtv7-0000r9-J1 for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 09:01:17 -0400 Received: by mail-ed1-f42.google.com with SMTP id e18so37630866edj.3 for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 06:01:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=NKK4fPy1oEGAJ3x9H6JoWVC2LysWvWwXHQPjHlUMTl4=; b=KcSmj6d1PehgXvqpem2qLCo2hSA4LD5kKh6QghaUG4WuJMlCFCcJA+JTWAOuey0wYm f1IsnApGXHnHhEOBgFGjaqQ82bL/WBqf4wN26K0lPf+I3Bso5ISesX8y0df9Hud/kCaE CMOLDXR/xzqPucnizsmuhudEJBuVitqo893T+c4iz4N/6gDLfOOaw9FUN2hf7PbuoXK/ IFZ6tC4CMxr0C2Yjef7biOi1GgnVSZIJYTp5cdvbAud1L0E1As4TMfnHfwsnG8decBw/ WM8qErWYAAp71ITJmMCXCjRr2ujf7S5b0Dv8ms68F9QnJGAnaZgErN481EuPFq3mViYc PYwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=NKK4fPy1oEGAJ3x9H6JoWVC2LysWvWwXHQPjHlUMTl4=; b=MFd/zddhZmT7gOVLaBTZTm2GIVoag7CCvckRYgHxRSFpPa4EWr9PDiwiPq0kUvglC5 /o/6n0oyAtaI08eBN+Hnl30wbk1XWPSLEVIusD0M3tXQUqr5JFrlQ/emBtET0fW0BJVS UES67NWVX6UUpy/RmpJ12GxY9yHVpOuKqoF6D7a9nLgQ8ToVCHZSlINlivk4apv9Sdmz Gzis0fw1PHsQrUZqSpqSALTBIhaZbsCFyMJgyPTCPzAnKC5s4JbZYciN3hgQWnw34mXE MS/Qd8M9MB4PEdoRlKT8+YQLVt5jbVhAgaMWbRpo958EMs3HTpZo0e6l58CVKA1ttw6e jNUg== X-Gm-Message-State: ACrzQf21kaM5MrKopfNhCRTidqiKQlFP4mlMLmBT9reof2kk+qNW3Umd HtyyUiXwdcmharyLE+anBCwnsINwRXzxuA== X-Google-Smtp-Source: AMsMyM6aWA2IzI9fFajdWr0Un4KqyQ3AGZTxrgaNNC5aIBNt2DMFParyF0AtExpl3bpkyA4r/rvysQ== X-Received: by 2002:a05:6402:f92:b0:44e:84e0:1d2a with SMTP id eh18-20020a0564020f9200b0044e84e01d2amr11448815edb.395.1663506067152; Sun, 18 Sep 2022 06:01:07 -0700 (PDT) Received: from Mini.fritz.box (pd9e3614c.dip0.t-ipconnect.de. [217.227.97.76]) by smtp.gmail.com with ESMTPSA id 12-20020a170906308c00b0077fbef08212sm9296161ejv.22.2022.09.18.06.01.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 18 Sep 2022 06:01:06 -0700 (PDT) From: =?utf-8?Q?Gerd_M=C3=B6llmann?= To: Philip Kaludercic Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87mtaw4zgh.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 18 Sep 2022 12:52:14 +0000") References: <87tu54dh3t.fsf@posteo.net> <87mtaw4zgh.fsf@posteo.net> Date: Sun, 18 Sep 2022 15:01:05 +0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (darwin) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Philip Kaludercic writes: > Interesting, I did not know this. But the point remains that Common > Lisp's loop accepts both the symbol "a" from the "COMMON-LISP" package > and from the "KEYWORD" package, right? Right, from any package. The reason is that otherwise one couldn't write (loop repeat ...), for example, if a package defines its own repeat symbol. >> Wouldn't it be nice if Emacs finally decided to have Common Lisp packages? > > Yeah, if only we could convince Emacs to do that ;) I could convince Emacs, amd I would even invest the effort doing this, seriously. But there are obstacles... Hold on, I'm getting my popcorn out :-) From debbugs-submit-bounces@debbugs.gnu.org Sun Sep 18 16:12:41 2022 Received: (at 57907) by debbugs.gnu.org; 18 Sep 2022 20:12:41 +0000 Received: from localhost ([127.0.0.1]:51375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oa0ed-0002jp-81 for submit@debbugs.gnu.org; Sun, 18 Sep 2022 16:12:41 -0400 Received: from mout01.posteo.de ([185.67.36.65]:43301) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oa0eZ-0002ja-K5 for 57907@debbugs.gnu.org; Sun, 18 Sep 2022 16:12:38 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 77D3E24002A for <57907@debbugs.gnu.org>; Sun, 18 Sep 2022 22:12:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663531949; bh=jjQ8kwxBfCDhc37MccLY99eJMhKckPEDNyS0tMwxFb4=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=kwYnG3mVoXjXeNvqxkfoYYjktLlveI4Qgtnu8zVx/vVjfZ+kayqokYwhlfOpX/JdA 9gFdmGtBnXmfO/d2YbAAgFNnK0XB7vz6uR5UoTy+s4fXO2xsh/9OPnXRwhb2UKLSio as8pNnCsDp94aUnnTgJkJ7d7MjZqsh11EV3ma2kji5usvyNwCQMjAiHYb7yJzd3C1z XA7X06uhLE/t8s9obiE2a9esh+wm9cqUkM0KryXak4rXsMuZOE8CyNCcj3rYC9Qlkn upwJ/u/t+FJQIC0BJAfsPIoHIRGEViWVIgi+2HXPqsht/0uTdRHHlDsvopkF+CIKWh B2R8mC1u0h75Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MVzW04Bxjz6tmN; Sun, 18 Sep 2022 22:12:27 +0200 (CEST) From: Philip Kaludercic To: help-debbugs@gnu.org (GNU bug Tracking System) Subject: Re: bug#57907: Acknowledgement (29.0.50; Using keywords with cl-loop) In-Reply-To: <87pmfsdg1l.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 18 Sep 2022 14:26:46 +0200") References: <87tu54dh3t.fsf@posteo.net> <87pmfsdg1l.fsf@posteo.net> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Sun, 18 Sep 2022 20:12:26 +0000 Message-ID: <87wna08ms5.fsf@posteo.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain Philip Kaludercic writes: > It seems it isn't that difficult to do this (though the patch is longer > than it ought to be because of indentation changes) It turned out to be a bit more difficult than I had assumed at first, but this patch should address the remaining issues I had: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Have-cl-loop-handle-keyword-symbols.patch >From a15a3d33b3ae4e2e8608da04978ed91b7c01187f Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Sun, 18 Sep 2022 14:25:29 +0200 Subject: [PATCH] Have 'cl-loop' handle keyword symbols * lisp/emacs-lisp/cl-macs.el (cl-loop): Add keywords to the edebug spec. (cl--parse-loop-clause): Handle keyword symbols by converting them into regular symbols. * doc/misc/cl.texi (Loop Basics): Mention that keywords are handled. * etc/NEWS: Mention it. (Bug#57907) --- doc/misc/cl.texi | 13 +- etc/NEWS | 3 + lisp/emacs-lisp/cl-macs.el | 964 +++++++++++++++++++------------------ 3 files changed, 510 insertions(+), 470 deletions(-) diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi index a6747b1096..2f64aa3f1e 100644 --- a/doc/misc/cl.texi +++ b/doc/misc/cl.texi @@ -1700,12 +1700,13 @@ Loop Basics @defmac cl-loop clauses@dots{} A loop construct consists of a series of @var{clause}s, each -introduced by a symbol like @code{for} or @code{do}. Clauses -are simply strung together in the argument list of @code{cl-loop}, -with minimal extra parentheses. The various types of clauses -specify initializations, such as the binding of temporary -variables, actions to be taken in the loop, stepping actions, -and final cleanup. +introduced by a symbol like @code{for} or @code{do}. Clauses are +simply strung together in the argument list of @code{cl-loop}, with +minimal extra parentheses. The various types of clauses specify +initializations, such as the binding of temporary variables, actions +to be taken in the loop, stepping actions, and final cleanup. +@code{cl-loop} can also handle keyword symbols, such as @code{:for} or +@code{:do}, in the same way as it would handle non-keyword symbols. Common Lisp specifies a certain general order of clauses in a loop: diff --git a/etc/NEWS b/etc/NEWS index e5d9b1ca23..b6862276f1 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -3801,6 +3801,9 @@ the same but works by modifying LIST destructively. --- ** 'string-split' is now an alias for 'split-string'. ++++ +** 'cl-loop' now handles keyword symbols. + * Changes in Emacs 29.1 on Non-Free Operating Systems diff --git a/lisp/emacs-lisp/cl-macs.el b/lisp/emacs-lisp/cl-macs.el index 5d330f32d6..74d0878689 100644 --- a/lisp/emacs-lisp/cl-macs.el +++ b/lisp/emacs-lisp/cl-macs.el @@ -946,6 +946,9 @@ cl-loop do EXPRS... [finally] return EXPR +All cl-loop keywords may also be written using keyword +symbols (e.g. `:for' is the same as `for'). + For more details, see Info node `(cl)Loop Facility'. \(fn CLAUSE...)" @@ -953,22 +956,24 @@ cl-loop ;; These are usually followed by a symbol, but it can ;; actually be any destructuring-bind pattern, which ;; would erroneously match `form'. - [[&or "for" "as" "with" "and"] sexp] + [[&or "for" ":for" "as" ":as" "with" ":with" "and" ":and"] sexp] ;; These are followed by expressions which could ;; erroneously match `symbolp'. - [[&or "from" "upfrom" "downfrom" "to" "upto" "downto" - "above" "below" "by" "in" "on" "=" "across" - "repeat" "while" "until" "always" "never" - "thereis" "collect" "append" "nconc" "sum" - "count" "maximize" "minimize" - "if" "when" "unless" - "return"] + [[&or "from" ":from" "upfrom" ":upfrom" "downfrom" ":downfrom" "to" + ":to" "upto" ":upto" "downto" ":downto" "above" ":above" + "below" ":below" "by" ":by" "in" ":in" "on" ":on" "=" ":=" + "across" ":across" "repeat" ":repeat" "while" ":while" "until" + ":until" "always" ":always" "never" ":never" "thereis" + ":thereis" "collect" ":collect" "append" ":append" "nconc" + ":nconc" "sum" ":sum" "count" ":count" "maximize" ":maximize" + "minimize" ":minimize" "if" ":if" "when" ":when" "unless" + ":unless" "return" ":return" ] form] ["using" (symbolp symbolp)] ;; Simple default, which covers 99% of the cases. symbolp form))) (if (not (memq t (mapcar #'symbolp - (delq nil (delq t (cl-copy-list loop-args)))))) + (delq nil (remq t loop-args))))) `(cl-block nil (while t ,@loop-args)) (let ((cl--loop-args loop-args) (cl--loop-name nil) (cl--loop-bindings nil) (cl--loop-body nil) (cl--loop-steps nil) @@ -1204,465 +1209,496 @@ cl--push-clause-loop-body ;; '(&or (loop-d-type-spec . [&or nil loop-d-type-spec]) cl-type-spec)) (defun cl--parse-loop-clause () ; uses loop-* - (let ((word (pop cl--loop-args)) - (hash-types '(hash-key hash-keys hash-value hash-values)) - (key-types '(key-code key-codes key-seq key-seqs - key-binding key-bindings))) - (cond + (cl-flet + ;; The following local functions are added to automatically + ;; convert loop-keywords that use keyword symbols to + ;; non-keyword symbols. E.g. we want + ;; + ;; (cl-loop :repeat foo :collect :bar) + ;; + ;; to do the same as + ;; + ;; (cl-loop repeat foo collect :bar) + ;; + ;; We can't generically replace all keyword symbols with + ;; non-keyword symbols because that could break things when we + ;; actually intend to have a keyword symbol. Instead the local + ;; functions are used whenever we want to query the next + ;; loop-keyword. + ((next () + (let ((word (pop cl--loop-args))) + (if (keywordp word) + (intern (substring (symbol-name word) 1)) + word))) + (next-2 () ;double-step `next' + (let ((word (cl--pop2 cl--loop-args))) + (if (keywordp word) + (intern (substring (symbol-name word) 1)) + word))) + (peek () + (let ((word (car cl--loop-args))) + (if (keywordp word) + (intern (substring (symbol-name word) 1)) + word)))) + (let ((word (next)) + (hash-types '(hash-key hash-keys hash-value hash-values)) + (key-types '(key-code key-codes key-seq key-seqs + key-binding key-bindings))) + (cond + + ((null cl--loop-args) + (error "Malformed `cl-loop' macro")) + + ((eq word 'named) + (setq cl--loop-name (pop cl--loop-args))) + + ((eq word 'initially) + (if (memq (peek) '(do doing)) (next)) + (or (consp (peek)) + (error "Syntax error on `initially' clause")) + (while (consp (peek)) + (push (pop cl--loop-args) cl--loop-initially))) + + ((eq word 'finally) + (if (eq (peek) 'return) + (setq cl--loop-result-explicit + (or (cl--pop2 cl--loop-args) '(quote nil))) + (if (memq (peek) '(do doing)) (next)) + (or (consp (peek)) + (error "Syntax error on `finally' clause")) + (if (and (eq (caar cl--loop-args) 'return) (null cl--loop-name)) + (setq cl--loop-result-explicit + (or (nth 1 (pop cl--loop-args)) '(quote nil))) + (while (consp (peek)) + (push (pop cl--loop-args) cl--loop-finally))))) + + ((memq word '(for as)) + (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil) + (ands nil)) + (while + ;; Use `cl-gensym' rather than `make-symbol'. It's important that + ;; (not (eq (symbol-name var1) (symbol-name var2))) because + ;; these vars get added to the macro-environment. + (let ((var (or (pop cl--loop-args) (cl-gensym "--cl-var--")))) + (setq word (next)) + (if (eq word 'being) (setq word (next))) + (if (memq word '(the each)) (setq word (next))) + (if (memq word '(buffer buffers)) + (setq word 'in + cl--loop-args (cons '(buffer-list) cl--loop-args))) + (cond - ((null cl--loop-args) - (error "Malformed `cl-loop' macro")) - - ((eq word 'named) - (setq cl--loop-name (pop cl--loop-args))) - - ((eq word 'initially) - (if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args)) - (or (consp (car cl--loop-args)) - (error "Syntax error on `initially' clause")) - (while (consp (car cl--loop-args)) - (push (pop cl--loop-args) cl--loop-initially))) - - ((eq word 'finally) - (if (eq (car cl--loop-args) 'return) - (setq cl--loop-result-explicit - (or (cl--pop2 cl--loop-args) '(quote nil))) - (if (memq (car cl--loop-args) '(do doing)) (pop cl--loop-args)) - (or (consp (car cl--loop-args)) - (error "Syntax error on `finally' clause")) - (if (and (eq (caar cl--loop-args) 'return) (null cl--loop-name)) - (setq cl--loop-result-explicit - (or (nth 1 (pop cl--loop-args)) '(quote nil))) - (while (consp (car cl--loop-args)) - (push (pop cl--loop-args) cl--loop-finally))))) - - ((memq word '(for as)) - (let ((loop-for-bindings nil) (loop-for-sets nil) (loop-for-steps nil) - (ands nil)) - (while - ;; Use `cl-gensym' rather than `make-symbol'. It's important that - ;; (not (eq (symbol-name var1) (symbol-name var2))) because - ;; these vars get added to the macro-environment. - (let ((var (or (pop cl--loop-args) (cl-gensym "--cl-var--")))) - (setq word (pop cl--loop-args)) - (if (eq word 'being) (setq word (pop cl--loop-args))) - (if (memq word '(the each)) (setq word (pop cl--loop-args))) - (if (memq word '(buffer buffers)) - (setq word 'in - cl--loop-args (cons '(buffer-list) cl--loop-args))) - (cond - - ((memq word '(from downfrom upfrom to downto upto - above below by)) - (push word cl--loop-args) - (if (memq (car cl--loop-args) '(downto above)) - (error "Must specify `from' value for downward cl-loop")) - (let* ((down (or (eq (car cl--loop-args) 'downfrom) - (memq (nth 2 cl--loop-args) - '(downto above)))) - (excl (or (memq (car cl--loop-args) '(above below)) - (memq (nth 2 cl--loop-args) - '(above below)))) - (start (and (memq (car cl--loop-args) - '(from upfrom downfrom)) - (cl--pop2 cl--loop-args))) - (end (and (memq (car cl--loop-args) - '(to upto downto above below)) - (cl--pop2 cl--loop-args))) - (step (and (eq (car cl--loop-args) 'by) - (cl--pop2 cl--loop-args))) - (end-var (and (not (macroexp-const-p end)) - (make-symbol "--cl-var--"))) - (step-var (and (not (macroexp-const-p step)) - (make-symbol "--cl-var--")))) - (and step (numberp step) (<= step 0) - (error "Loop `by' value is not positive: %s" step)) - (push (list var (or start 0)) loop-for-bindings) - (if end-var (push (list end-var end) loop-for-bindings)) - (if step-var (push (list step-var step) - loop-for-bindings)) - (when end + ((memq word '(from downfrom upfrom to downto upto + above below by)) + (push word cl--loop-args) + (if (memq (peek) '(downto above)) + (error "Must specify `from' value for downward cl-loop")) + (let* ((down (or (eq (peek) 'downfrom) + (memq (nth 2 cl--loop-args) + '(downto above)))) + (excl (or (memq (peek) '(above below)) + (memq (nth 2 cl--loop-args) + '(above below)))) + (start (and (memq (peek) + '(from upfrom downfrom)) + (next-2))) + (end (and (memq (peek) + '(to upto downto above below)) + (next-2))) + (step (and (eq (peek) 'by) + (next-2))) + (end-var (and (not (macroexp-const-p end)) + (make-symbol "--cl-var--"))) + (step-var (and (not (macroexp-const-p step)) + (make-symbol "--cl-var--")))) + (and step (numberp step) (<= step 0) + (error "Loop `by' value is not positive: %s" step)) + (push (list var (or start 0)) loop-for-bindings) + (if end-var (push (list end-var end) loop-for-bindings)) + (if step-var (push (list step-var step) + loop-for-bindings)) + (when end + (cl--push-clause-loop-body + (list + (if down (if excl '> '>=) (if excl '< '<=)) + var (or end-var end)))) + (push (list var (list (if down '- '+) var + (or step-var step 1))) + loop-for-steps))) + + ((memq word '(in in-ref on)) + (let* ((on (eq word 'on)) + (temp (if (and on (symbolp var)) + var (make-symbol "--cl-var--")))) + (push (list temp (pop cl--loop-args)) loop-for-bindings) + (cl--push-clause-loop-body `(consp ,temp)) + (if (eq word 'in-ref) + (push (list var `(car ,temp)) cl--loop-symbol-macs) + (or (eq temp var) + (progn + (push (list var nil) loop-for-bindings) + (push (list var (if on temp `(car ,temp))) + loop-for-sets)))) + (push (list temp + (if (eq (peek) 'by) + (let ((step (cl--pop2 cl--loop-args))) + (if (and (memq (car-safe step) + '(quote function + cl-function)) + (symbolp (nth 1 step))) + (list (nth 1 step) temp) + `(funcall ,step ,temp))) + `(cdr ,temp))) + loop-for-steps))) + + ((eq word '=) + (let* ((start (next)) + (then (if (eq (peek) 'then) + (cl--pop2 cl--loop-args) start)) + (first-assign (or cl--loop-first-flag + (setq cl--loop-first-flag + (make-symbol "--cl-var--"))))) + (push (list var nil) loop-for-bindings) + (if (or ands (eq (peek) 'and)) + (progn + (push `(,var (if ,first-assign ,start ,var)) loop-for-sets) + (push `(,var (if ,(car (cl--loop-build-ands + (nreverse cl--loop-conditions))) + ,then ,var)) + loop-for-steps)) + (push (if (eq start then) + `(,var ,then) + `(,var (if ,first-assign ,start ,then))) + loop-for-sets)))) + + ((memq word '(across across-ref)) + (let ((temp-vec (make-symbol "--cl-vec--")) + (temp-idx (make-symbol "--cl-idx--"))) + (push (list temp-vec (pop cl--loop-args)) loop-for-bindings) + (push (list temp-idx -1) loop-for-bindings) + (push `(setq ,temp-idx (1+ ,temp-idx)) cl--loop-body) (cl--push-clause-loop-body - (list - (if down (if excl '> '>=) (if excl '< '<=)) - var (or end-var end)))) - (push (list var (list (if down '- '+) var - (or step-var step 1))) - loop-for-steps))) - - ((memq word '(in in-ref on)) - (let* ((on (eq word 'on)) - (temp (if (and on (symbolp var)) - var (make-symbol "--cl-var--")))) - (push (list temp (pop cl--loop-args)) loop-for-bindings) - (cl--push-clause-loop-body `(consp ,temp)) - (if (eq word 'in-ref) - (push (list var `(car ,temp)) cl--loop-symbol-macs) - (or (eq temp var) - (progn - (push (list var nil) loop-for-bindings) - (push (list var (if on temp `(car ,temp))) - loop-for-sets)))) - (push (list temp - (if (eq (car cl--loop-args) 'by) - (let ((step (cl--pop2 cl--loop-args))) - (if (and (memq (car-safe step) - '(quote function - cl-function)) - (symbolp (nth 1 step))) - (list (nth 1 step) temp) - `(funcall ,step ,temp))) - `(cdr ,temp))) - loop-for-steps))) - - ((eq word '=) - (let* ((start (pop cl--loop-args)) - (then (if (eq (car cl--loop-args) 'then) - (cl--pop2 cl--loop-args) start)) - (first-assign (or cl--loop-first-flag - (setq cl--loop-first-flag - (make-symbol "--cl-var--"))))) - (push (list var nil) loop-for-bindings) - (if (or ands (eq (car cl--loop-args) 'and)) - (progn - (push `(,var (if ,first-assign ,start ,var)) loop-for-sets) - (push `(,var (if ,(car (cl--loop-build-ands - (nreverse cl--loop-conditions))) - ,then ,var)) - loop-for-steps)) - (push (if (eq start then) - `(,var ,then) - `(,var (if ,first-assign ,start ,then))) - loop-for-sets)))) - - ((memq word '(across across-ref)) - (let ((temp-vec (make-symbol "--cl-vec--")) - (temp-idx (make-symbol "--cl-idx--"))) - (push (list temp-vec (pop cl--loop-args)) loop-for-bindings) - (push (list temp-idx -1) loop-for-bindings) - (push `(setq ,temp-idx (1+ ,temp-idx)) cl--loop-body) - (cl--push-clause-loop-body - `(< ,temp-idx (length ,temp-vec))) - (if (eq word 'across-ref) - (push (list var `(aref ,temp-vec ,temp-idx)) - cl--loop-symbol-macs) - (push (list var nil) loop-for-bindings) - (push (list var `(aref ,temp-vec ,temp-idx)) - loop-for-sets)))) - - ((memq word '(element elements)) - (let ((ref (or (memq (car cl--loop-args) '(in-ref of-ref)) - (and (not (memq (car cl--loop-args) '(in of))) - (error "Expected `of'")))) - (seq (cl--pop2 cl--loop-args)) - (temp-seq (make-symbol "--cl-seq--")) - (temp-idx - (if (eq (car cl--loop-args) 'using) - (if (and (= (length (cadr cl--loop-args)) 2) - (eq (caadr cl--loop-args) 'index)) - (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) - (make-symbol "--cl-idx--")))) - (push (list temp-seq seq) loop-for-bindings) - (push (list temp-idx 0) loop-for-bindings) - (if ref - (let ((temp-len (make-symbol "--cl-len--"))) - (push (list temp-len `(length ,temp-seq)) - loop-for-bindings) - (push (list var `(elt ,temp-seq ,temp-idx)) - cl--loop-symbol-macs) - (cl--push-clause-loop-body `(< ,temp-idx ,temp-len))) - (push (list var nil) loop-for-bindings) - (cl--push-clause-loop-body `(and ,temp-seq - (or (consp ,temp-seq) - (< ,temp-idx (length ,temp-seq))))) - (push (list var `(if (consp ,temp-seq) - (pop ,temp-seq) - (aref ,temp-seq ,temp-idx))) - loop-for-sets)) - (push (list temp-idx `(1+ ,temp-idx)) - loop-for-steps))) - - ((memq word hash-types) - (or (memq (car cl--loop-args) '(in of)) - (error "Expected `of'")) - (let* ((table (cl--pop2 cl--loop-args)) - (other - (if (eq (car cl--loop-args) 'using) - (if (and (= (length (cadr cl--loop-args)) 2) - (memq (caadr cl--loop-args) hash-types) - (not (eq (caadr cl--loop-args) word))) - (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) - (make-symbol "--cl-var--")))) - (if (memq word '(hash-value hash-values)) - (setq var (prog1 other (setq other var)))) - (cl--loop-set-iterator-function - 'hash-tables (lambda (body) - `(maphash (lambda (,var ,other) . ,body) - ,table))))) - - ((memq word '(symbol present-symbol external-symbol - symbols present-symbols external-symbols)) - (let ((ob (and (memq (car cl--loop-args) '(in of)) - (cl--pop2 cl--loop-args)))) - (cl--loop-set-iterator-function - 'symbols (lambda (body) - `(mapatoms (lambda (,var) . ,body) ,ob))))) - - ((memq word '(overlay overlays extent extents)) - (let ((buf nil) (from nil) (to nil)) - (while (memq (car cl--loop-args) '(in of from to)) - (cond ((eq (car cl--loop-args) 'from) - (setq from (cl--pop2 cl--loop-args))) - ((eq (car cl--loop-args) 'to) - (setq to (cl--pop2 cl--loop-args))) - (t (setq buf (cl--pop2 cl--loop-args))))) - (cl--loop-set-iterator-function - 'overlays (lambda (body) - `(cl--map-overlays - (lambda (,var ,(make-symbol "--cl-var--")) - (progn . ,body) nil) - ,buf ,from ,to))))) - - ((memq word '(interval intervals)) - (let ((buf nil) (prop nil) (from nil) (to nil) - (var1 (make-symbol "--cl-var1--")) - (var2 (make-symbol "--cl-var2--"))) - (while (memq (car cl--loop-args) '(in of property from to)) - (cond ((eq (car cl--loop-args) 'from) - (setq from (cl--pop2 cl--loop-args))) - ((eq (car cl--loop-args) 'to) - (setq to (cl--pop2 cl--loop-args))) - ((eq (car cl--loop-args) 'property) - (setq prop (cl--pop2 cl--loop-args))) - (t (setq buf (cl--pop2 cl--loop-args))))) - (if (and (consp var) (symbolp (car var)) (symbolp (cdr var))) - (setq var1 (car var) var2 (cdr var)) - (push (list var `(cons ,var1 ,var2)) loop-for-sets)) - (cl--loop-set-iterator-function - 'intervals (lambda (body) - `(cl--map-intervals - (lambda (,var1 ,var2) . ,body) - ,buf ,prop ,from ,to))))) - - ((memq word key-types) - (or (memq (car cl--loop-args) '(in of)) - (error "Expected `of'")) - (let ((cl-map (cl--pop2 cl--loop-args)) - (other - (if (eq (car cl--loop-args) 'using) - (if (and (= (length (cadr cl--loop-args)) 2) - (memq (caadr cl--loop-args) key-types) - (not (eq (caadr cl--loop-args) word))) - (cadr (cl--pop2 cl--loop-args)) - (error "Bad `using' clause")) - (make-symbol "--cl-var--")))) - (if (memq word '(key-binding key-bindings)) - (setq var (prog1 other (setq other var)))) - (cl--loop-set-iterator-function - 'keys (lambda (body) - `(,(if (memq word '(key-seq key-seqs)) - 'cl--map-keymap-recursively 'map-keymap) - (lambda (,var ,other) . ,body) ,cl-map))))) - - ((memq word '(frame frames screen screens)) - (let ((temp (make-symbol "--cl-var--"))) - (push (list var '(selected-frame)) - loop-for-bindings) - (push (list temp nil) loop-for-bindings) - (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) - (or ,temp (setq ,temp ,var)))) - (push (list var `(next-frame ,var)) - loop-for-steps))) - - ((memq word '(window windows)) - (let ((scr (and (memq (car cl--loop-args) '(in of)) - (cl--pop2 cl--loop-args))) - (temp (make-symbol "--cl-var--")) - (minip (make-symbol "--cl-minip--"))) - (push (list var (if scr - `(frame-selected-window ,scr) - '(selected-window))) - loop-for-bindings) - ;; If we started in the minibuffer, we need to - ;; ensure that next-window will bring us back there - ;; at some point. (Bug#7492). - ;; (Consider using walk-windows instead of cl-loop if - ;; you care about such things.) - (push (list minip `(minibufferp (window-buffer ,var))) - loop-for-bindings) - (push (list temp nil) loop-for-bindings) - (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) - (or ,temp (setq ,temp ,var)))) - (push (list var `(next-window ,var ,minip)) - loop-for-steps))) - - (t - ;; This is an advertised interface: (info "(cl)Other Clauses"). - (let ((handler (and (symbolp word) - (get word 'cl-loop-for-handler)))) - (if handler - (funcall handler var) - (error "Expected a `for' preposition, found %s" word))))) - (eq (car cl--loop-args) 'and)) - (setq ands t) - (pop cl--loop-args)) - (if (and ands loop-for-bindings) - (push (nreverse loop-for-bindings) cl--loop-bindings) - (setq cl--loop-bindings (nconc (mapcar #'list loop-for-bindings) - cl--loop-bindings))) - (if loop-for-sets - (push `(progn - ,(cl--loop-let (nreverse loop-for-sets) 'setq ands) + `(< ,temp-idx (length ,temp-vec))) + (if (eq word 'across-ref) + (push (list var `(aref ,temp-vec ,temp-idx)) + cl--loop-symbol-macs) + (push (list var nil) loop-for-bindings) + (push (list var `(aref ,temp-vec ,temp-idx)) + loop-for-sets)))) + + ((memq word '(element elements)) + (let ((ref (or (memq (peek) '(in-ref of-ref)) + (and (not (memq (peek) '(in of))) + (error "Expected `of'")))) + (seq (cl--pop2 cl--loop-args)) + (temp-seq (make-symbol "--cl-seq--")) + (temp-idx + (if (eq (peek) 'using) + (if (and (= (length (cadr cl--loop-args)) 2) + (eq (caadr cl--loop-args) 'index)) + (cadr (cl--pop2 cl--loop-args)) + (error "Bad `using' clause")) + (make-symbol "--cl-idx--")))) + (push (list temp-seq seq) loop-for-bindings) + (push (list temp-idx 0) loop-for-bindings) + (if ref + (let ((temp-len (make-symbol "--cl-len--"))) + (push (list temp-len `(length ,temp-seq)) + loop-for-bindings) + (push (list var `(elt ,temp-seq ,temp-idx)) + cl--loop-symbol-macs) + (cl--push-clause-loop-body `(< ,temp-idx ,temp-len))) + (push (list var nil) loop-for-bindings) + (cl--push-clause-loop-body `(and ,temp-seq + (or (consp ,temp-seq) + (< ,temp-idx (length ,temp-seq))))) + (push (list var `(if (consp ,temp-seq) + (pop ,temp-seq) + (aref ,temp-seq ,temp-idx))) + loop-for-sets)) + (push (list temp-idx `(1+ ,temp-idx)) + loop-for-steps))) + + ((memq word hash-types) + (or (memq (peek) '(in of)) + (error "Expected `of'")) + (let* ((table (cl--pop2 cl--loop-args)) + (other + (if (eq (peek) 'using) + (if (and (= (length (cadr cl--loop-args)) 2) + (memq (caadr cl--loop-args) hash-types) + (not (eq (caadr cl--loop-args) word))) + (cadr (cl--pop2 cl--loop-args)) + (error "Bad `using' clause")) + (make-symbol "--cl-var--")))) + (if (memq word '(hash-value hash-values)) + (setq var (prog1 other (setq other var)))) + (cl--loop-set-iterator-function + 'hash-tables (lambda (body) + `(maphash (lambda (,var ,other) . ,body) + ,table))))) + + ((memq word '(symbol present-symbol external-symbol + symbols present-symbols external-symbols)) + (let ((ob (and (memq (peek) '(in of)) + (cl--pop2 cl--loop-args)))) + (cl--loop-set-iterator-function + 'symbols (lambda (body) + `(mapatoms (lambda (,var) . ,body) ,ob))))) + + ((memq word '(overlay overlays extent extents)) + (let ((buf nil) (from nil) (to nil)) + (while (memq (peek) '(in of from to)) + (cond ((eq (peek) 'from) + (setq from (cl--pop2 cl--loop-args))) + ((eq (peek) 'to) + (setq to (cl--pop2 cl--loop-args))) + (t (setq buf (cl--pop2 cl--loop-args))))) + (cl--loop-set-iterator-function + 'overlays (lambda (body) + `(cl--map-overlays + (lambda (,var ,(make-symbol "--cl-var--")) + (progn . ,body) nil) + ,buf ,from ,to))))) + + ((memq word '(interval intervals)) + (let ((buf nil) (prop nil) (from nil) (to nil) + (var1 (make-symbol "--cl-var1--")) + (var2 (make-symbol "--cl-var2--"))) + (while (memq (peek) '(in of property from to)) + (cond ((eq (peek) 'from) + (setq from (cl--pop2 cl--loop-args))) + ((eq (peek) 'to) + (setq to (cl--pop2 cl--loop-args))) + ((eq (peek) 'property) + (setq prop (cl--pop2 cl--loop-args))) + (t (setq buf (cl--pop2 cl--loop-args))))) + (if (and (consp var) (symbolp (car var)) (symbolp (cdr var))) + (setq var1 (car var) var2 (cdr var)) + (push (list var `(cons ,var1 ,var2)) loop-for-sets)) + (cl--loop-set-iterator-function + 'intervals (lambda (body) + `(cl--map-intervals + (lambda (,var1 ,var2) . ,body) + ,buf ,prop ,from ,to))))) + + ((memq word key-types) + (or (memq (peek) '(in of)) + (error "Expected `of'")) + (let ((cl-map (cl--pop2 cl--loop-args)) + (other + (if (eq (peek) 'using) + (if (and (= (length (cadr cl--loop-args)) 2) + (memq (caadr cl--loop-args) key-types) + (not (eq (caadr cl--loop-args) word))) + (cadr (cl--pop2 cl--loop-args)) + (error "Bad `using' clause")) + (make-symbol "--cl-var--")))) + (if (memq word '(key-binding key-bindings)) + (setq var (prog1 other (setq other var)))) + (cl--loop-set-iterator-function + 'keys (lambda (body) + `(,(if (memq word '(key-seq key-seqs)) + 'cl--map-keymap-recursively 'map-keymap) + (lambda (,var ,other) . ,body) ,cl-map))))) + + ((memq word '(frame frames screen screens)) + (let ((temp (make-symbol "--cl-var--"))) + (push (list var '(selected-frame)) + loop-for-bindings) + (push (list temp nil) loop-for-bindings) + (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) + (or ,temp (setq ,temp ,var)))) + (push (list var `(next-frame ,var)) + loop-for-steps))) + + ((memq word '(window windows)) + (let ((scr (and (memq (peek) '(in of)) + (cl--pop2 cl--loop-args))) + (temp (make-symbol "--cl-var--")) + (minip (make-symbol "--cl-minip--"))) + (push (list var (if scr + `(frame-selected-window ,scr) + '(selected-window))) + loop-for-bindings) + ;; If we started in the minibuffer, we need to + ;; ensure that next-window will bring us back there + ;; at some point. (Bug#7492). + ;; (Consider using walk-windows instead of cl-loop if + ;; you care about such things.) + (push (list minip `(minibufferp (window-buffer ,var))) + loop-for-bindings) + (push (list temp nil) loop-for-bindings) + (cl--push-clause-loop-body `(prog1 (not (eq ,var ,temp)) + (or ,temp (setq ,temp ,var)))) + (push (list var `(next-window ,var ,minip)) + loop-for-steps))) + + (t + ;; This is an advertised interface: (info "(cl)Other Clauses"). + (let ((handler (and (symbolp word) + (get word 'cl-loop-for-handler)))) + (if handler + (funcall handler var) + (error "Expected a `for' preposition, found %s" word))))) + (eq (peek) 'and)) + (setq ands t) + (pop cl--loop-args)) + (if (and ands loop-for-bindings) + (push (nreverse loop-for-bindings) cl--loop-bindings) + (setq cl--loop-bindings (nconc (mapcar #'list loop-for-bindings) + cl--loop-bindings))) + (if loop-for-sets + (push `(progn + ,(cl--loop-let (nreverse loop-for-sets) 'setq ands) + t) + cl--loop-body)) + (when loop-for-steps + (push (cons (if ands 'cl-psetq 'setq) + (apply #'append (nreverse loop-for-steps))) + cl--loop-steps)))) + + ((eq word 'repeat) + (let ((temp (make-symbol "--cl-var--"))) + (push (list (list temp (pop cl--loop-args))) cl--loop-bindings) + (push `(>= (setq ,temp (1- ,temp)) 0) cl--loop-body))) + + ((memq word '(collect collecting)) + (let ((what (pop cl--loop-args)) + (var (cl--loop-handle-accum nil 'nreverse))) + (if (eq var cl--loop-accum-var) + (push `(progn (push ,what ,var) t) cl--loop-body) + (push `(progn + (setq ,var (nconc ,var (list ,what))) t) - cl--loop-body)) - (when loop-for-steps - (push (cons (if ands 'cl-psetq 'setq) - (apply #'append (nreverse loop-for-steps))) - cl--loop-steps)))) - - ((eq word 'repeat) - (let ((temp (make-symbol "--cl-var--"))) - (push (list (list temp (pop cl--loop-args))) cl--loop-bindings) - (push `(>= (setq ,temp (1- ,temp)) 0) cl--loop-body))) - - ((memq word '(collect collecting)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum nil 'nreverse))) - (if (eq var cl--loop-accum-var) - (push `(progn (push ,what ,var) t) cl--loop-body) - (push `(progn - (setq ,var (nconc ,var (list ,what))) + cl--loop-body)))) + + ((memq word '(nconc nconcing append appending)) + (let ((what (pop cl--loop-args)) + (var (cl--loop-handle-accum nil 'nreverse))) + (push `(progn + (setq ,var + ,(if (eq var cl--loop-accum-var) + `(nconc + (,(if (memq word '(nconc nconcing)) + #'nreverse #'reverse) + ,what) + ,var) + `(,(if (memq word '(nconc nconcing)) + #'nconc #'append) + ,var ,what))) t) - cl--loop-body)))) - - ((memq word '(nconc nconcing append appending)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum nil 'nreverse))) - (push `(progn - (setq ,var - ,(if (eq var cl--loop-accum-var) - `(nconc - (,(if (memq word '(nconc nconcing)) - #'nreverse #'reverse) - ,what) - ,var) - `(,(if (memq word '(nconc nconcing)) - #'nconc #'append) - ,var ,what))) - t) - cl--loop-body))) - - ((memq word '(concat concating)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum ""))) - (push `(progn (cl-callf concat ,var ,what) t) cl--loop-body))) - - ((memq word '(vconcat vconcating)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum []))) - (push `(progn (cl-callf vconcat ,var ,what) t) cl--loop-body))) - - ((memq word '(sum summing)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum 0))) - (push `(progn (cl-incf ,var ,what) t) cl--loop-body))) - - ((memq word '(count counting)) - (let ((what (pop cl--loop-args)) - (var (cl--loop-handle-accum 0))) - (push `(progn (if ,what (cl-incf ,var)) t) cl--loop-body))) - - ((memq word '(minimize minimizing maximize maximizing)) - (push `(progn ,(macroexp-let2 macroexp-copyable-p temp - (pop cl--loop-args) - (let* ((var (cl--loop-handle-accum nil)) - (func (intern (substring (symbol-name word) - 0 3)))) - `(setq ,var (if ,var (,func ,var ,temp) ,temp)))) - t) - cl--loop-body)) - - ((eq word 'with) - (let ((bindings nil)) - (while (progn (push (list (pop cl--loop-args) - (and (eq (car cl--loop-args) '=) - (cl--pop2 cl--loop-args))) - bindings) - (eq (car cl--loop-args) 'and)) - (pop cl--loop-args)) - (push (nreverse bindings) cl--loop-bindings))) - - ((eq word 'while) - (push (pop cl--loop-args) cl--loop-body)) - - ((eq word 'until) - (push `(not ,(pop cl--loop-args)) cl--loop-body)) - - ((eq word 'always) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) - (push `(setq ,cl--loop-finish-flag ,(pop cl--loop-args)) cl--loop-body) - (setq cl--loop-result t)) - - ((eq word 'never) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) - (push `(setq ,cl--loop-finish-flag (not ,(pop cl--loop-args))) - cl--loop-body) - (setq cl--loop-result t)) - - ((eq word 'thereis) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) - (or cl--loop-result-var - (setq cl--loop-result-var (make-symbol "--cl-var--"))) - (push `(setq ,cl--loop-finish-flag - (not (setq ,cl--loop-result-var ,(pop cl--loop-args)))) - cl--loop-body)) - - ((memq word '(if when unless)) - (let* ((cond (pop cl--loop-args)) - (then (let ((cl--loop-body nil)) - (cl--parse-loop-clause) - (cl--loop-build-ands (nreverse cl--loop-body)))) - (else (let ((cl--loop-body nil)) - (if (eq (car cl--loop-args) 'else) - (progn (pop cl--loop-args) (cl--parse-loop-clause))) - (cl--loop-build-ands (nreverse cl--loop-body)))) - (simple (and (eq (car then) t) (eq (car else) t)))) - (if (eq (car cl--loop-args) 'end) (pop cl--loop-args)) - (if (eq word 'unless) (setq then (prog1 else (setq else then)))) - (let ((form (cons (if simple (cons 'progn (nth 1 then)) (nth 2 then)) - (if simple (nth 1 else) (list (nth 2 else)))))) - (setq form (if (cl--expr-contains form 'it) - `(let ((it ,cond)) (if it ,@form)) - `(if ,cond ,@form))) - (push (if simple `(progn ,form t) form) cl--loop-body)))) - - ((memq word '(do doing)) - (let ((body nil)) - (or (consp (car cl--loop-args)) (error "Syntax error on `do' clause")) - (while (consp (car cl--loop-args)) (push (pop cl--loop-args) body)) - (push (cons 'progn (nreverse (cons t body))) cl--loop-body))) - - ((eq word 'return) - (or cl--loop-finish-flag - (setq cl--loop-finish-flag (make-symbol "--cl-var--"))) - (or cl--loop-result-var - (setq cl--loop-result-var (make-symbol "--cl-var--"))) - (push `(setq ,cl--loop-result-var ,(pop cl--loop-args) - ,cl--loop-finish-flag nil) - cl--loop-body)) - - (t - ;; This is an advertised interface: (info "(cl)Other Clauses"). - (let ((handler (and (symbolp word) (get word 'cl-loop-handler)))) - (or handler (error "Expected a cl-loop keyword, found %s" word)) - (funcall handler)))) - (if (eq (car cl--loop-args) 'and) - (progn (pop cl--loop-args) (cl--parse-loop-clause))))) + cl--loop-body))) + + ((memq word '(concat concating)) + (let ((what (pop cl--loop-args)) + (var (cl--loop-handle-accum ""))) + (push `(progn (cl-callf concat ,var ,what) t) cl--loop-body))) + + ((memq word '(vconcat vconcating)) + (let ((what (pop cl--loop-args)) + (var (cl--loop-handle-accum []))) + (push `(progn (cl-callf vconcat ,var ,what) t) cl--loop-body))) + + ((memq word '(sum summing)) + (let ((what (pop cl--loop-args)) + (var (cl--loop-handle-accum 0))) + (push `(progn (cl-incf ,var ,what) t) cl--loop-body))) + + ((memq word '(count counting)) + (let ((what (pop cl--loop-args)) + (var (cl--loop-handle-accum 0))) + (push `(progn (if ,what (cl-incf ,var)) t) cl--loop-body))) + + ((memq word '(minimize minimizing maximize maximizing)) + (push `(progn ,(macroexp-let2 macroexp-copyable-p temp + (pop cl--loop-args) + (let* ((var (cl--loop-handle-accum nil)) + (func (intern (substring (symbol-name word) + 0 3)))) + `(setq ,var (if ,var (,func ,var ,temp) ,temp)))) + t) + cl--loop-body)) + + ((eq word 'with) + (let ((bindings nil)) + (while (progn (push (list (pop cl--loop-args) + (and (eq (peek) '=) + (cl--pop2 cl--loop-args))) + bindings) + (eq (peek) 'and)) + (pop cl--loop-args)) + (push (nreverse bindings) cl--loop-bindings))) + + ((eq word 'while) + (push (pop cl--loop-args) cl--loop-body)) + + ((eq word 'until) + (push `(not ,(pop cl--loop-args)) cl--loop-body)) + + ((eq word 'always) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) + (push `(setq ,cl--loop-finish-flag ,(pop cl--loop-args)) cl--loop-body) + (setq cl--loop-result t)) + + ((eq word 'never) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) + (push `(setq ,cl--loop-finish-flag (not ,(pop cl--loop-args))) + cl--loop-body) + (setq cl--loop-result t)) + + ((eq word 'thereis) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-flag--"))) + (or cl--loop-result-var + (setq cl--loop-result-var (make-symbol "--cl-var--"))) + (push `(setq ,cl--loop-finish-flag + (not (setq ,cl--loop-result-var ,(pop cl--loop-args)))) + cl--loop-body)) + + ((memq word '(if when unless)) + (let* ((cond (pop cl--loop-args)) + (then (let ((cl--loop-body nil)) + (cl--parse-loop-clause) + (cl--loop-build-ands (nreverse cl--loop-body)))) + (else (let ((cl--loop-body nil)) + (if (eq (peek) 'else) + (progn (pop cl--loop-args) (cl--parse-loop-clause))) + (cl--loop-build-ands (nreverse cl--loop-body)))) + (simple (and (eq (car then) t) (eq (car else) t)))) + (if (eq (peek) 'end) (pop cl--loop-args)) + (if (eq word 'unless) (setq then (prog1 else (setq else then)))) + (let ((form (cons (if simple (cons 'progn (nth 1 then)) (nth 2 then)) + (if simple (nth 1 else) (list (nth 2 else)))))) + (setq form (if (cl--expr-contains form 'it) + `(let ((it ,cond)) (if it ,@form)) + `(if ,cond ,@form))) + (push (if simple `(progn ,form t) form) cl--loop-body)))) + + ((memq word '(do doing)) + (let ((body nil)) + (or (consp (peek)) (error "Syntax error on `do' clause")) + (while (consp (peek)) (push (pop cl--loop-args) body)) + (push (cons 'progn (nreverse (cons t body))) cl--loop-body))) + + ((eq word 'return) + (or cl--loop-finish-flag + (setq cl--loop-finish-flag (make-symbol "--cl-var--"))) + (or cl--loop-result-var + (setq cl--loop-result-var (make-symbol "--cl-var--"))) + (push `(setq ,cl--loop-result-var ,(pop cl--loop-args) + ,cl--loop-finish-flag nil) + cl--loop-body)) + + (t + ;; This is an advertised interface: (info "(cl)Other Clauses"). + (let ((handler (and (symbolp word) (get word 'cl-loop-handler)))) + (or handler (error "Expected a cl-loop keyword, found %s" word)) + (funcall handler)))) + (if (eq (peek) 'and) + (progn (pop cl--loop-args) (cl--parse-loop-clause)))))) (defun cl--unused-var-p (sym) (or (null sym) (eq ?_ (aref (symbol-name sym) 0)))) -- 2.37.3 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 04:06:23 2022 Received: (at 57907) by debbugs.gnu.org; 19 Sep 2022 08:06:23 +0000 Received: from localhost ([127.0.0.1]:52246 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBnL-0007sl-By for submit@debbugs.gnu.org; Mon, 19 Sep 2022 04:06:23 -0400 Received: from quimby.gnus.org ([95.216.78.240]:47544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBnJ-0007sX-E2 for 57907@debbugs.gnu.org; Mon, 19 Sep 2022 04:06:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=QxZ9okmCbqcgDW5j8+VH2Ny4GD7lS9rm05lC4dssZa4=; b=n4kMKY4zO0Bgk/Zyq4QsSwpHrI tT4Cu2Xs5z0I0Dn0uGS60iALRF6Xo9Rz0WHRMM31aJRkrtPFGIsznmIA5Mbss1uWKuzCiuH/CLX2J yaVqMUvYfNaQk5KKn0mKYDrkiieJQTIm/MOMngnDPNkAR4vc8mKheBO2NxJjuvq1cq4c=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaBnA-000702-SY; Mon, 19 Sep 2022 10:06:14 +0200 From: Lars Ingebrigtsen To: Philip Kaludercic Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <874jx46eat.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 18 Sep 2022 12:46:18 +0000") References: <87tu54dh3t.fsf@posteo.net> <87wna027sr.fsf@gnus.org> <87leqgdfz1.fsf@posteo.net> <87sfko2702.fsf@gnus.org> <874jx46eat.fsf@posteo.net> Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAABGdBTUEAALGPC/xhBQAAACBj SFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAALVBMVEXu7u3Y0NfGoK/P NkTdV2e3rsuZeYdLOkUTBw9kV14nEhlLJio2IiosGiP////Zf5E1AAAAAWJLR0QOb70wTwAAAAd0 SU1FB+YJEwcsIERlldwAAAGOSURBVDjLrdK9TsJQFAfwYuJOE0kMkcHi4iq+AKUvwEA0xBV4Az4S WeV4oaNCBRcXLhe7Yk2ZhVSZ+xH6LrYF1J7WxMH/eH+959xzeznuKzz330nyPJ8Mr2Rzu5xtlxKC kD+RxKzkJ3cuSTvYE0VRkIRsTioUQju2OZB2yf/xPIlU9ZjfJAz7NbgpBSkiOJ0+xUPfaFXiIKUs G9/wY/pU8aESX6o0qsSXKtUqA9tbr96F4aLfrw5pS2nDbRjKzKR2GwAIgittDJN5DJTpmKrUA1zq EkyHAIlC2V3QWDj6WPt1SBRc1weg0R0r73tCZQwZdwlkOKXgIDhULZnN3y2QEaQpdHVdN2J6LLtz XVcdhnuoBmGMMAtDmvjDgRPZkWZTzYOXXhTWj8DgTXUjwEYe2E0jCg2v1HNzjU/F4BpkCosOBkJW /t3OiMmF3lWGBceFWdPGpZh35xQmA9wcZOIPYtcioAalVKWDwSLBr62bGOgGXhuoOQSPCmCi/ALd ezygBsw3gqGnseBhkTrHfQIpVOojvKi+iAAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wOS0xOVQw Nzo0NDozMiswMDowMHsDNFgAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDktMTlUMDc6NDQ6MzIr MDA6MDAKXozkAAAAAElFTkSuQmCC X-Now-Playing: Anne Clark's _Hopeless Cases_: "Now" Date: Mon, 19 Sep 2022 10:06:12 +0200 Message-ID: <87pmfryeiz.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philip Kaludercic writes: > I phrased that clumsily -- while it is a new language, it doesn't always > have to feel like one. And I'm saying that that feeling is a misleading feeling -- we're leading the users down the garden path. Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907 Cc: 57907@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > I phrased that clumsily -- while it is a new language, it doesn't always > have to feel like one. And I'm saying that that feeling is a misleading feeling -- we're leading the users down the garden path. > E.g. the repeat-collect example I gave before. > If you *can* use keywords, you *can* make some cl-loop invocations > appear to be a macro or a function call with keyword-arguments. > > But of course this wouldn't be the case, as the macro should stay > backwards compatible. I understand that. But it means that the stated rationale for this change does the users a disservice. So I'm against extending cl-loop in this way. Gerd has explained why it works this way in Common Lisp (because CL doesn't have any other choice because that's the way the language works), but we should not shoehorn in this accident into Emacs, too. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 06:16:58 2022 Received: (at 57907-done) by debbugs.gnu.org; 19 Sep 2022 10:16:59 +0000 Received: from localhost ([127.0.0.1]:52494 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaDpi-0007a9-LR for submit@debbugs.gnu.org; Mon, 19 Sep 2022 06:16:58 -0400 Received: from mout01.posteo.de ([185.67.36.65]:39151) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaDpe-0007Zs-Fq for 57907-done@debbugs.gnu.org; Mon, 19 Sep 2022 06:16:56 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 710F9240029 for <57907-done@debbugs.gnu.org>; Mon, 19 Sep 2022 12:16:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1663582608; bh=+svJWgJqc2LlyccypmxNWI5aRdlT6dQulU6XJvxwEkI=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=ki3WcqVe/nRNBApVfYTu5iGUsLe04v1hmejBOp+bchsKqrT6xnLNBS5xpQoz6CxEA d29CyZP5NruSgf0/4AtoxHGpjWPimJMaYGP9viqYTWpsT/eTf3O72kFcacATF903Xf QLI5+VNYx15FPdlksD7aBG+dJv/znY2efgn052kfpu2i7nh5V29ITr8WcNCiv0ibzb QKNChEhfYDb08bk4w6LQ6sIsGIQ8H5B8MD7iU4Oy9vt/+uM5AoSfVD+y2NJkqep3Bj GoNmVFMbCESqH/bLTA3oGMjisIQexLod+vHgeN3KtU8hTzaYXEp3G2aUpqMoG1y1VH qY7uOG7YDDGQw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MWLFC45NYz9rxR; Mon, 19 Sep 2022 12:16:47 +0200 (CEST) From: Philip Kaludercic To: Lars Ingebrigtsen Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <87pmfryeiz.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 19 Sep 2022 10:06:12 +0200") References: <87tu54dh3t.fsf@posteo.net> <87wna027sr.fsf@gnus.org> <87leqgdfz1.fsf@posteo.net> <87sfko2702.fsf@gnus.org> <874jx46eat.fsf@posteo.net> <87pmfryeiz.fsf@gnus.org> Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Date: Mon, 19 Sep 2022 10:16:47 +0000 Message-ID: <874jx3fz3k.fsf@posteo.net> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907-done Cc: 57907-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Lars Ingebrigtsen writes: > Philip Kaludercic writes: > >> I phrased that clumsily -- while it is a new language, it doesn't always >> have to feel like one. > > And I'm saying that that feeling is a misleading feeling -- we're > leading the users down the garden path. > >> E.g. the repeat-collect example I gave before. >> If you *can* use keywords, you *can* make some cl-loop invocations >> appear to be a macro or a function call with keyword-arguments. >> >> But of course this wouldn't be the case, as the macro should stay >> backwards compatible. > > I understand that. But it means that the stated rationale for this > change does the users a disservice. > > So I'm against extending cl-loop in this way. Gerd has explained why > it works this way in Common Lisp (because CL doesn't have any other > choice because that's the way the language works), but we should not > shoehorn in this accident into Emacs, too. While it might have had been an accident initially, I don't think it has to be considered such. As I said, there are reasons like syntax highlighting for preferring keyword-symbols. But if you don't think this is a good idea, I'll go ahead and close the issue. From debbugs-submit-bounces@debbugs.gnu.org Mon Sep 19 08:52:56 2022 Received: (at 57907-done) by debbugs.gnu.org; 19 Sep 2022 12:52:56 +0000 Received: from localhost ([127.0.0.1]:52664 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaGGe-0005VR-0f for submit@debbugs.gnu.org; Mon, 19 Sep 2022 08:52:56 -0400 Received: from quimby.gnus.org ([95.216.78.240]:50476) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaGGb-0005VD-Sw for 57907-done@debbugs.gnu.org; Mon, 19 Sep 2022 08:52:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References: In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZIJ08f1eEE3X884/QBs6zFYl+1nWSAbikRie/PXvgFE=; b=AjxueYvceKgW0Ma2PgclKYVQkX Q0jeCD/4YhlI7cSi1DPIedOYz644d4wAcAj+0sCuHeicYyZfW4GyqlAWfQsgEdYoTBv9cnfVy0MI/ MU5s0vOqcvl7S+07NNiwzUmfFFYRaRb2cPHWol1hvtQVYUrbgznoK2GzmsYiPvuYC/nU=; Received: from [84.212.220.105] (helo=joga) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaGGS-0000dU-Pw; Mon, 19 Sep 2022 14:52:47 +0200 From: Lars Ingebrigtsen To: Philip Kaludercic Subject: Re: bug#57907: 29.0.50; Using keywords with cl-loop In-Reply-To: <874jx3fz3k.fsf@posteo.net> (Philip Kaludercic's message of "Mon, 19 Sep 2022 10:16:47 +0000") References: <87tu54dh3t.fsf@posteo.net> <87wna027sr.fsf@gnus.org> <87leqgdfz1.fsf@posteo.net> <87sfko2702.fsf@gnus.org> <874jx46eat.fsf@posteo.net> <87pmfryeiz.fsf@gnus.org> <874jx3fz3k.fsf@posteo.net> X-Now-Playing: Jesca Hoop's _Memories Are Now_: "Songs of Old" Date: Mon, 19 Sep 2022 14:52:44 +0200 Message-ID: <87r107ttk3.fsf@gnus.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see @@CONTACT_ADDRESS@@ for details. Content preview: Philip Kaludercic writes: > While it might have had been an accident initially, I don't think it has > to be considered such. As I said, there are reasons like syntax > highlighting for preferring keyword-symbols. But if you d [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 57907-done Cc: 57907-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Philip Kaludercic writes: > While it might have had been an accident initially, I don't think it has > to be considered such. As I said, there are reasons like syntax > highlighting for preferring keyword-symbols. But if you don't think > this is a good idea, I'll go ahead and close the issue. I think we could probably get better syntax highlighting without keywords if somebody took that on. My general lack of enthusiasm for this is that this offers syntactical variation without any practical advantages either way. This means that some people will choose one syntax, and others will choose the other, and we get code churn when people "correct" the code from one to another. From unknown Fri Jun 20 07:18:40 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 18 Oct 2022 11:24:05 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator