From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: (*) -> 1 Date: Thu, 19 Jan 2023 16:19:46 +0100 Message-ID: <87r0vqa67k.fsf@gnu.org> References: <87y1q1kvdm.fsf@web.de> <87h6wpkrlq.fsf@web.de> <87zgahj7h3.fsf@web.de> <878rhzvs1h.fsf@web.de> <87ilh28w9u.fsf@web.de> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="14505"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.9.16; emacs 30.0.50 Cc: Michael Heerdegen , help-gnu-emacs@gnu.org To: Jean Louis Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 19 16:35:40 2023 Return-path: Envelope-to: geh-help-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 1pIWx1-0003Tr-MH for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 19 Jan 2023 16:35:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pIWwO-0005yz-3O; Thu, 19 Jan 2023 10:35:00 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIWwF-0005vt-Jm for help-gnu-emacs@gnu.org; Thu, 19 Jan 2023 10:34:56 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pIWwA-00048r-Gv; Thu, 19 Jan 2023 10:34:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-reply-to:Date:Subject:To:From: References; bh=30nowhf4yn3TXRQ1pcBcBJUD0gJ6iTi42bOZhul8ey4=; b=LIo7BbzWLVd96I x5eRF4kB9oJLZmvPnfMd2Z5c5aHaBVhdN+8wfR9k3bLYDMBtu2jcSvNS7quEEcdoTXYYRJBv4PnY8 AfDgc2nJzHDQ0ydA0ZlPMF7Wka9qD+u3TZ3Gypj68rY/swry31jABEoJvqVqZeSKUUpjG/vAl19ed PDe0Xmt1XLa6ed4nREhMGQNhYrdb35goSQZwejcZXqZT/Fc2dE/bnkszYm9o9rM5kmKBeLbyWcRnL GRLEq9Fv430f4wj1H/55ihEGS6bt5ABNYVxFeTGT3XY6LVjQZ9AhUBFXs8MtfhfSYiUl+r+q2+QhC Z34dVnEvBowjtfdkU03Q==; Original-Received: from auth1-smtp.messagingengine.com ([66.111.4.227]) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pIWw6-0000s9-I1; Thu, 19 Jan 2023 10:34:46 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailauth.nyi.internal (Postfix) with ESMTP id BC8BF27C0054; Thu, 19 Jan 2023 10:34:41 -0500 (EST) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Thu, 19 Jan 2023 10:34:41 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddutddgjeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesthdtredttdertdenucfhrhhomhepvfgrshhs ihhlohcujfhorhhnuceothhsughhsehgnhhurdhorhhgqeenucggtffrrghtthgvrhhnpe dujedtheduvdelffejkeetgedvheelhedvueefhfeukeekkeehvdfggeegffevgfenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhorhhnod hmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdekieejfeekjeekgedqieefhedv leekqdhtshguhheppehgnhhurdhorhhgsehfrghsthhmrghilhdrfhhm X-ME-Proxy: Feedback-ID: ib2b94485:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Jan 2023 10:34:40 -0500 (EST) In-reply-to: X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:142429 Archived-At: Jean Louis writes: > You found examples I am searching, though you can't provide references > where (*) is useful. Gosh, Jean, of course nobody would literally write (*) but (apply #'* ...), and you'll find occurrences in emacs: --8<---------------cut here---------------start------------->8--- find -H . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.src -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o \! -type d \( -name .\#\* -o -name \*.out -o -name \*.synctex.gz -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl -o -name \*.fx32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o -type f \( -iname \*.el \) -exec grep --color=auto -i -nH --null -e \(apply\ \#\'\\\* \{\} + ./gnus/spam-stat.el:494: (prod (apply #'* probs)) ./gnus/spam-stat.el:496: (/ prod (+ prod (apply #'* (mapcar (lambda (x) (- 1 x)) ./org/org-plot.el:232: (apply #'* (org--plot/nice-frequency-pick weighted-factors)))) ./org/org-plot.el:259: (< (* (apply #'* f-pick) 2-val) 30)) ./org/org-plot.el:262: (< (* (apply #'* f-pick) 3-val) 30)) ./htmlfontify.el:1055: (let ((n (apply #'* m))) --8<---------------cut here---------------end--------------->8--- And even more with (apply #'+ ...): --8<---------------cut here---------------start------------->8--- find -H . -type d \( -path \*/SCCS -o -path \*/RCS -o -path \*/CVS -o -path \*/MCVS -o -path \*/.src -o -path \*/.svn -o -path \*/.git -o -path \*/.hg -o -path \*/.bzr -o -path \*/_MTN -o -path \*/_darcs -o -path \*/\{arch\} \) -prune -o \! -type d \( -name .\#\* -o -name \*.out -o -name \*.synctex.gz -o -name \*.o -o -name \*\~ -o -name \*.bin -o -name \*.lbin -o -name \*.so -o -name \*.a -o -name \*.ln -o -name \*.blg -o -name \*.bbl -o -name \*.elc -o -name \*.lof -o -name \*.glo -o -name \*.idx -o -name \*.lot -o -name \*.fmt -o -name \*.tfm -o -name \*.class -o -name \*.fas -o -name \*.lib -o -name \*.mem -o -name \*.x86f -o -name \*.sparcf -o -name \*.dfsl -o -name \*.pfsl -o -name \*.d64fsl -o -name \*.p64fsl -o -name \*.lx64fsl -o -name \*.lx32fsl -o -name \*.dx64fsl -o -name \*.dx32fsl -o -name \*.fx64fsl -o -name \*.fx32fsl -o -name \*.sx64fsl -o -name \*.sx32fsl -o -name \*.wx64fsl -o -name \*.wx32fsl -o -name \*.fasl -o -name \*.ufsl -o -name \*.fsl -o -name \*.dxl -o -name \*.lo -o -name \*.la -o -name \*.gmo -o -name \*.mo -o -name \*.toc -o -name \*.aux -o -name \*.cp -o -name \*.fn -o -name \*.ky -o -name \*.pg -o -name \*.tp -o -name \*.vr -o -name \*.cps -o -name \*.fns -o -name \*.kys -o -name \*.pgs -o -name \*.tps -o -name \*.vrs -o -name \*.pyc -o -name \*.pyo \) -prune -o -type f \( -iname \*.el \) -exec grep --color=auto -i -nH --null -e \(apply\ \#\'\+ \{\} + ./leim/quail/hangul.el:341: (if (zerop (apply #'+ (append hangul-queue nil))) ./leim/quail/hangul.el:353: (if (not (zerop (apply #'+ (append hangul-queue nil)))) ./net/newst-backend.el:2186: (apply #'+ ./net/imap.el:1810: (apply #'+ (mapcar #'imap-body-lines body))) ./net/shr.el:2350: (let ((extra (- (apply #'+ (append suggested-widths nil)) ./net/shr.el:2351: (apply #'+ (append widths nil)) ./treesit.el:2608: (eq 0 (apply #'+ (mapcar #'treesit-node-child-count children)))) ./textmodes/texinfmt.el:2044: (apply #'+ texinfo-multitable-width-list)))) ./gnus/gnus-picon.el:217: (setq len (apply #'+ (mapcar (lambda (x) ./gnus/gnus-cache.el:889: (apply #'+ entry) ./gnus/gnus-score.el:2560: (apply #'+ (mapcar ./gnus/gnus-sum.el:3836: (apply #'+ (mapcar ./gnus/gnus-sum.el:8840: (apply #'+ (mapcar #'gnus-summary-limit-children ./gnus/gnus-agent.el:4139: (apply #'+ entry) ./gnus/spam-stat.el:515: (apply #'+ scores)))) ./calendar/solar.el:753: (apply #'+ ./calendar/solar.el:941: (S (apply #'+ (mapcar (lambda(x) ./calendar/todo-mode.el:3697: (mapcar (lambda (i) (apply #'+ (mapcar (lambda (x) (aref (cdr x) i)) ./ses.el:625: ses--linewidth (apply #'+ -1 (mapcar #'1+ widths)) ./ses.el:4037: (apply #'+ (apply #'ses-delete-blanks args))) ./ses.el:4044: (/ (float (apply #'+ list)) (length list))) ./org/org-plot.el:246: (let* ((total-count (apply #'+ (mapcar #'cdr frequencies))) ./org/org-colview.el:1261: (format (or printf "%s") (apply #'+ (mapcar #'string-to-number values)))) ./org/org-colview.el:1265: (format "%.2f" (apply #'+ (mapcar #'string-to-number values)))) ./org/org-colview.el:1306: (/ (apply #'+ (mapcar #'string-to-number values)) ./org/org-colview.el:1324: (lambda (&rest values) (/ (apply #'+ values) (float (length values)))) ./org/org-colview.el:1340: (/ (apply #'+ (mapcar #'org-columns--age-to-minutes ages)) ./org/org-clock.el:2626: (total-time (apply #'+ (mapcar #'cadr tables))) ./minibuffer.el:2025: (apply #'+ (mapcar #'string-width s)) ./minibuffer.el:2068: (apply #'+ (mapcar #'string-width str)) ./pcomplete.el:943: (let* ((envpos (apply #'+ (mapcar #' length strings))) ./progmodes/cc-guess.el:368: (apply #'+ ./progmodes/sql.el:3639: (apply #'+ (mapcar (lambda (ch) (if (eq ch ?\n) 1 0)) ./progmodes/vhdl-mode.el:7480: (apply #'+ (mapcar #'vhdl-get-offset syntax))) ./obsolete/thumbs.el:207: (dirsize (apply #'+ (mapcar (lambda (x) (cadr x)) files-list)))) ./obsolete/landmark.el:1428: (apply #'+ ./emacs-lisp/memory-report.el:254: (apply #'+ ./emacs-lisp/bytecomp.el:4515: (let ((nvalues (apply #'+ (mapcar (lambda (case) (length (car case))) ./emacs-lisp/smie.el:2219: (cl-assert (= total (apply #'+ (mapcar #'cdr off-alist)))) --8<---------------cut here---------------end--------------->8--- It's totally sensible to be able to compute the product/sum of an arbitrary number of numbers. All these would need checks for non-empty lists or even lists of at least 2 numbers if + and * would require at least 1 or 2 arguments. Bye, Tassilo