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.tangents Subject: Re: (*) -> 1 Date: Fri, 20 Jan 2023 19:06:41 +0300 Message-ID: References: <878rhzvs1h.fsf@web.de> <87ilh28w9u.fsf@web.de> <87r0vqa67k.fsf@gnu.org> <87edrplgee.fsf@gnu.org> <87a62dl55j.fsf@gnu.org> 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="24970"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mutt/2.2.9+54 (af2080d) (2022-11-21) Cc: emacs-tangents@gnu.org To: Tassilo Horn Original-X-From: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Sat Jan 21 08:18:14 2023 Return-path: Envelope-to: get-emacs-tangents@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 1pJ88j-0006JL-B8 for get-emacs-tangents@m.gmane-mx.org; Sat, 21 Jan 2023 08:18:13 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJ88M-0004UQ-Cb; Sat, 21 Jan 2023 02:17:50 -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 1pJ7xF-0000Zy-3j for emacs-tangents@gnu.org; Sat, 21 Jan 2023 02:06:21 -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 1pJ7xD-0003vZ-7z; Sat, 21 Jan 2023 02:06:20 -0500 Original-Received: from localhost ([::ffff:197.239.14.92]) (AUTH: PLAIN admin, TLS: TLS1.3,256bits,ECDHE_RSA_AES_256_GCM_SHA384) by stw1.rcdrun.com with ESMTPSA id 000000000010394C.0000000063CB8ECB.00002BD8; Sat, 21 Jan 2023 00:05:46 -0700 Content-Disposition: inline In-Reply-To: <87a62dl55j.fsf@gnu.org> Received-SPF: pass client-ip=217.170.207.13; envelope-from=bugs@gnu.support; helo=stw1.rcdrun.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, DATE_IN_PAST_12_24=1.049, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 21 Jan 2023 02:17:48 -0500 X-BeenThere: emacs-tangents@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Emacs news and miscellaneous discussions outside the scope of other Emacs mailing lists List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Original-Sender: emacs-tangents-bounces+get-emacs-tangents=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.tangents:973 Archived-At: * Tassilo Horn [2023-01-20 16:14]: > Jean Louis writes: > > >> Yes, and I think it's seriously wrong with > >> > >> : (+) > >> -> NIL > >> > >> where its docs say > >> > >> Returns the sum of all num arguments. When one of the arguments > >> evaluates to NIL, it is returned immediately. > > > > For some reason PicoLisp is quite different than other Lisp. I have > > asked author about it. > > > > 15:09 It is a "feature" that NIL propagates through > > arithmetics > > Well, but with (*) and (+), there is no single NIL involved! And in > Elisp (+ nil), where actually a nil is involved, you get an error. What we can learn from PicoLisp is that there was no use for (*) ➜ 1 and that programs work, GUI applications and Android/Replicant work, and there was no use of (*) ➜ 1 so far. Similarly like author of PicoLisp finding use when (*) ➜ NIL, so I would also find (very rare) use with errors. Even if NIL, I find use as I will get error raised in combinations like (+ (*) (* 2 2)), because (+ nil 4) would raise error. > > 15:09 How does it help instead of providing identity > > elements? > > 15:09 (*) especially was not contemplated though, it is a > > pretty useless call > > [...] > > 15:12 What is a call like (*) useful for? > > > > As you see, author also asked naturally why is it useful. > > So go and ask why he thinks (apply '+ ()) -> NIL is more useful than 0 > given that the sum of the empty set of numbers _is_ 0. I will ask. But docstring does not speak of empty sets. You introduce "sets" where there is not direct relation to it. (+ &rest NUMBERS-OR-MARKERS) Return sum of any number of arguments, which are numbers or markers. Of course I get confused. I ask A, but people say B. I ask A, but people say C. I ask A, but people say D. No answer about A. But there are many introductions of things not relevant to function itself. I still believe that there is some actual practical use. `apply' can be used with (apply '+ '(a b)) as why would you need in apply for addition two arguments? If list is with one argument, testing with `cadr' will be known, otherwise, I use `car' instead of `apply'. > >> So why does it return NIL? And why do you apparently consider that > >> useful? And can something be useful even though it is incorrect? > > > > I find it right as with error raising or nil I can find what is > > wrong. > > It's good to signal an error when the expression is wrong as does Elisp > with > > (+ nil) > (* 1 2 nil) > (apply #'+ (list 1 nil 19)) > (+ 2 "i am not a number") That is exactly my point, what you see useful there, I see too. Making it less error prone with useless default identity elements hides the real event preceding the operation. -- Jean Take action in Free Software Foundation campaigns: https://www.fsf.org/campaigns In support of Richard M. Stallman https://stallmansupport.org/