From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Louis Newsgroups: gmane.emacs.help Subject: Re: [External] : Re: How to make M-x TAB not work on (interactive) declaration? Date: Tue, 17 Jan 2023 20:19:44 +0300 Message-ID: References: <61c2cc81db661e2624771a06a1274eac.support1@rcdrun.com> <87y1qdct5m.fsf@gnu.org> <874jt0imh0.fsf@dataswamp.org> <87edrtqgaq.fsf@alphaville.usersys.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3443"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: help-gnu-emacs@gnu.org To: Nick Dokos Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 17 18:20:59 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 1pHpdq-0000dp-Lp for geh-help-gnu-emacs@m.gmane-mx.org; Tue, 17 Jan 2023 18:20:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHpdm-00072Y-Eb; Tue, 17 Jan 2023 12:20:54 -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 1pHpdQ-0006pk-20 for help-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:20:45 -0500 Original-Received: from stw1.rcdrun.com ([217.170.207.13]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHpdO-0006E8-74 for help-gnu-emacs@gnu.org; Tue, 17 Jan 2023 12:20:31 -0500 Original-Received: from localhost ([::ffff:102.85.233.9]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 00000000000561C1.0000000063C6D8E0.000025DA; Tue, 17 Jan 2023 10:20:32 -0700 Mail-Followup-To: Nick Dokos , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <87edrtqgaq.fsf@alphaville.usersys.redhat.com> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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:142323 Archived-At: * Nick Dokos [2023-01-17 19:27]: > The "empty sum" and "empty product" conventions are described in the > corresponding articles in Wikipedia too - they might help: > > https://en.wikipedia.org/wiki/Empty_sum > https://en.wikipedia.org/wiki/Empty_product Thanks much. I understand that "summation" is not equal to "addition" as summation is the addition of a sequence of any kind of numbers, called addends or summands; the result is their sum or total: https://en.wikipedia.org/wiki/Summation Then back to: https://en.wikipedia.org/wiki/Empty_sum where it says: In mathematics, an empty sum, or nullary sum,[1] is a summation where the number of terms is zero. The natural way to extend non-empty sums[2] is to let the empty sum be the additive identity. Basically function `+' deals with summation, not with addition. But that is conclusion I can draw alone with help of your references, without confirmation by docstring, manual or some references. Though I do not understand why it has to deal with summation, and not straight with addition? What is use in Lisp? In this other reference: https://en.wikipedia.org/wiki/Empty_product the issue with Lisp is mentioned, and we can read, that in many programming languages it is so, like in Python, Lisp, but in Perl is not so, then it says: Multiplication is an infix operator and therefore a binary operator, complicating the notation of an empty product. Some programming languages handle this by implementing variadic functions. For example, the fully parenthesized prefix notation of Lisp languages gives rise to a natural notation for nullary functions: (* 2 2 2) ; evaluates to 8 (* 2 2) ; evaluates to 4 (* 2) ; evaluates to 2 (*) ; evaluates to 1 and: In mathematics and in computer programming, a variadic function is a function of indefinite arity, i.e., one which accepts a variable number of arguments. Support for variadic functions differs widely among programming languages. I may alone assume, while still needing confirmation, that Emacs Lisp, Common Lisp use those variadic function. Not that I have got stable feeling with it. Though that still does not tell me why? I have excluded the purpose for `apply' and similar functions as that is handled properly with PicoLisp where (*) ➜ NIL -- and maybe I am wrong, but with all references I came closer some reasoning. But all the reasoning is not confirmed in Lisp books. What I understand from C is thet if number of args nargs is 0 is that result shall be 1 -- that alone does not explain why and how is it useful in Lisp. DEFUN ("*", Ftimes, Stimes, 0, MANY, 0, doc: /* Return product of any number of arguments, which are numbers or markers. usage: (* &rest NUMBERS-OR-MARKERS) */) (ptrdiff_t nargs, Lisp_Object *args) { if (nargs == 0) return make_fixnum (1); Lisp_Object a = check_number_coerce_marker (args[0]); return nargs == 1 ? a : arith_driver (Amult, nargs, args, a); } -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/