From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nathan Benedetto =?UTF-8?Q?Proen=C3=A7a?= Newsgroups: gmane.emacs.bugs Subject: bug#43995: 27.1; Argument orderd in function parameter of seq-reduce Date: Wed, 14 Oct 2020 15:54:54 -0300 Message-ID: <87zh4owsch.fsf@archlinux.i-did-not-set--mail-host-address--so-tickle-me> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5713"; mail-complaints-to="usenet@ciao.gmane.io" To: 43995@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 14 22:25:15 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kSnKl-0001Lw-3T for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Oct 2020 22:25:15 +0200 Original-Received: from localhost ([::1]:36440 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSnKj-0003nl-UM for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 14 Oct 2020 16:25:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53574) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSnKa-0003nL-AZ for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2020 16:25:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41555) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSnKa-00014d-13 for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2020 16:25:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kSnKZ-0007UK-UH for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2020 16:25:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nathan Benedetto =?UTF-8?Q?Proen=C3=A7a?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 14 Oct 2020 20:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 43995 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.160270708328717 (code B ref -1); Wed, 14 Oct 2020 20:25:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 14 Oct 2020 20:24:43 +0000 Original-Received: from localhost ([127.0.0.1]:53097 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSnKD-0007T4-LB for submit@debbugs.gnu.org; Wed, 14 Oct 2020 16:24:43 -0400 Original-Received: from lists.gnu.org ([209.51.188.17]:38600) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kSlvf-0003CR-JJ for submit@debbugs.gnu.org; Wed, 14 Oct 2020 14:55:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35922) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSlvf-0004Ms-99 for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2020 14:55:15 -0400 Original-Received: from mail-qt1-x843.google.com ([2607:f8b0:4864:20::843]:38188) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSlvc-0006ay-5A for bug-gnu-emacs@gnu.org; Wed, 14 Oct 2020 14:55:14 -0400 Original-Received: by mail-qt1-x843.google.com with SMTP id q26so82506qtb.5 for ; Wed, 14 Oct 2020 11:55:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vieiraproenca-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=4iWU+xpv4jUdDbHZzZM0YT/OmdkJmVpKnQDyzcQNI0c=; b=zMxcVYeRhElof9Ic+zkEpAOQRNhnweb0bs+P0RhZJOe7XHyMIgwBb95QbdoDKR9HFO ePNfWuvOQth5I7M1LjelG5HcNh8LlIADEPGc9+g+iP8grGHVyMDu1CEfxyB0u60QsCG1 fy5ipbOM5BMLlyK+pi0OnL2/1kUeL7Z0IS7uh67HJkpbuQNjxsD3Dy42w1xJkjrlnA/R nz07gBpnPsDlbrVbmAgAbizeMk8zOgEPDIDXP9If/Qyg7zYVkbKm0m5GCvyJiiWyg2ly ev9ErapzNd8Ek4h7EyGad9FBwel907FQ027nnmM98nv+IgG8Vr6O96mgq2XEjmSYc/Um tnRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=4iWU+xpv4jUdDbHZzZM0YT/OmdkJmVpKnQDyzcQNI0c=; b=K7b9Do4XycO4HWeiGlE6Ugn63b4zveTszuAd/cx6NcQCgfcG1ZsW8sGlGEZstJncZy WtOpM6bODYFOkjGggT1dFG0hUDz80KYtLyFoqCS5vYFxzqy+1M9RP+4Oy51snNkcV1Sp /n1aVp5v9myn1rHrr+Xe4pDzg1FqihInCSLrURgXz2pj+YfgtYQ75fJ2nJ05swSyWFYw qNuypeckvgeuTXJvB2kp5fblWueM1VlP0JlvAxrK+NK3ZJ4ze2FFd8k8iJSOO5lWrxR9 k7Rjx9ID5qgxsbmJBSxAmBM33NNBKL4lGtT/b371gbQnU1inRrxJCovwJUsp4ams+fO/ +27A== X-Gm-Message-State: AOAM533EUzDQsfO1PMAKnZzkuK0lG5MEXKIV5eCa6S7WUasJXH48J7pW R0fFNS/lcu4EspXch+mWN+VNp4ZUr8DFyaTbKuc= X-Google-Smtp-Source: ABdhPJyYcz7WuOAN4MLrX3zcEWEMNZnSGF3hsdNDsv4EMGxjSw2L1ZG1Ys2Kq6ZqwA5lSon9tEd1hw== X-Received: by 2002:ac8:5709:: with SMTP id 9mr574198qtw.77.1602701708280; Wed, 14 Oct 2020 11:55:08 -0700 (PDT) Original-Received: from archlinux ([179.93.143.195]) by smtp.gmail.com with ESMTPSA id r17sm169115qtc.22.2020.10.14.11.55.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Oct 2020 11:55:07 -0700 (PDT) Received-SPF: neutral client-ip=2607:f8b0:4864:20::843; envelope-from=nathan@vieiraproenca.com; helo=mail-qt1-x843.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -10 X-Spam_score: -1.1 X-Spam_bar: - X-Spam_report: (-1.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 14 Oct 2020 16:24:40 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:190522 Archived-At: Good afternoon! This is not a bug per se, but I was directed here by https://github.com/NicolasPetton/seq.el I want to know if there is any guarantee regarding the order of parameters passed to the FUNCTION argument in seq-reduce. 'C-h f seq-reduce RET' tells me that: > seq-reduce is an autoloaded compiled Lisp function in =E2=80=98seq.el=E2= =80=99. >=20 > (seq-reduce FUNCTION SEQUENCE INITIAL-VALUE) >=20 > Reduce the function FUNCTION across SEQUENCE, starting with INITIAL-VALUE. >=20 > Return the result of calling FUNCTION with INITIAL-VALUE and the > first element of SEQUENCE, then calling FUNCTION with that result and > the second element of SEQUENCE, then with that result and the third > element of SEQUENCE, etc. >=20 > If SEQUENCE is empty, return INITIAL-VALUE and FUNCTION is not called. The wording gave me the impression that the first argument of FUNCTION is the accumulator, and the second is the element of the SEQUENCE, but I was not sure. By inspecting the code, I saw that this was indeed the case. This mattered because I had a closure as an accumulator, and wanted to update this closure by iterating over a list whose elements where not closures. The example in the Elisp book https://www.gnu.org/software/emacs/manual/html_node/elisp/Sequence-Function= s.html#Sequence-Functions uses addition, in which this issue does not arise. If it is a good idea, I could update the docstring and the manual, but I would need some pointers on how to do it. Thanks in advance! Nathan In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.22, cair= o version 1.17.3) of 2020-08-28 built on juergen Windowing system distributor 'The X.Org Foundation', version 11.0.12009000 System Description: Arch Linux Recent messages: Making completion list... Type "q" in help window to restore its previous buffer. Auto-saving... mouse-2, RET: find function's definition Mark set completing-read-default: Command attempted to use minibuffer while in minib= uffer Quit Making completion list... [3 times] Making completion list... Configured using: 'configure --prefix=3D/usr --sysconfdir=3D/etc --libexecdir=3D/usr/lib --localstatedir=3D/var --with-x-toolkit=3Dgtk3 --with-xft --with-wide-int --with-modules --with-cairo --with-harfbuzz 'CFLAGS=3D-march=3Dx86-64 -mtune=3Dgeneric -O2 -pipe -fno-plt' CPPFLAGS=3D-D_FORTIFY_SOURCE=3D2 LDFLAGS=3D-Wl,-O1,--sort-common,--as-needed,-z,relro,-z,now' Configured features: XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND GPM DBUS GSETTINGS GLIB NOTIFY INOTIFY ACL GNUTLS LIBXML2 FREETYPE HARFBUZZ M17N_FLT LIBOTF ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON PDUMPER LCMS2 GMP Important settings: value of $LANG: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Help Minor modes in effect: global-magit-file-mode: t magit-auto-revert-mode: t global-git-commit-mode: t async-bytecomp-package-mode: t show-paren-mode: t shell-dirtrack-mode: t TeX-PDF-mode: t delete-selection-mode: t electric-pair-mode: t tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr reporter emacsbug sendmail magit-extras face-remap 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 smerge-mode diff magit-core magit-autorevert autorevert filenotify magit-margin magit-transient magit-process magit-mode git-commit transient magit-git magit-section magit-utils log-edit pcvs-util add-log with-editor async-bytecomp async pcmpl-unix em-unix em-term term disp-table ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-dirs esh-var em-cmpl em-basic em-banner em-alias esh-mode conf-mode vc-git flyspell ispell org-element avl-tree generator ol-eww ol-rmail ol-mhe ol-irc ol-info ol-gnus nnir gnus-sum url url-proxy url-privacy url-expand url-methods url-history gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int gnus-range gnus-win gnus nnheader ol-docview doc-view image-mode exif ol-bibtex bibtex ol-bbdb ol-w3m macros jka-compr misearch multi-isearch eieio-opt cl-extra speedbar sb-image ezimage dframe help-fns radix-tree help-mode shr-color color shr url-cookie url-domsuf url-util svg dom mule-util pp server paren paredit ffap ob-ruby ob-shell shell ob-eshell eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util the-org-mode-expansions org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-footnote org-src ob-comint org-pcomplete pcomplete org-list org-faces org-entities noutline outline org-version ob-emacs-lisp ob-core ob-eval org-table ol org-keys org-compat org-macs org-loaddefs find-func notmuch hl-line notmuch-tree notmuch-jump notmuch-hello wid-edit notmuch-show notmuch-print notmuch-crypto notmuch-mua notmuch-message notmuch-draft notmuch-maildir-fcc notmuch-address notmuch-company notmuch-parser notmuch-wash diff-mode coolj notmuch-query goto-addr icalendar diary-lib diary-loaddefs cal-menu calendar cal-loaddefs notmuch-tag notmuch-lib notmuch-version notmuch-compat message rmc puny dired dired-loaddefs format-spec rfc822 mml mailabbrev gmm-utils mailheader mm-view mml-smime mml-sec epa derived epg epg-config gnus-util rmail rmail-loaddefs mail-utils text-property-search time-date smime dig mm-decode mm-bodies mm-encode mailcap mail-parse rfc2231 rfc2047 rfc2045 mm-util ietf-drums mail-prsvr rx font-latex reftex reftex-loaddefs reftex-vars auctex-latexmk tex-buf latex-mode-expansions latex easy-mmode latex-flymake flymake-proc flymake compile comint ansi-color ring warnings tex-ispell tex-style tex dbus xml crm texmathp delsel expand-region text-mode-expansions er-basic-expansions thingatpt expand-region-core advice expand-region-custom elec-pair edmacro kmacro gruvbox-dark-hard-theme gruvbox autothemer dash finder-inf tex-site info package easymenu browse-url url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json subr-x map url-vars seq byte-opt gv bytecomp byte-compile cconv cl-loaddefs cl-lib tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame minibuffer cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 510123 116089) (symbols 48 38222 1) (strings 32 166206 24816) (string-bytes 1 4963351) (vectors 16 63944) (vector-slots 8 1315342 52348) (floats 8 454 397) (intervals 56 8162 891) (buffers 1000 36))