all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jean Louis <bugs@gnu.support>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: (*) -> 1
Date: Tue, 17 Jan 2023 21:04:18 +0300	[thread overview]
Message-ID: <Y8bjItPWgBLLdR9s@protected.localdomain> (raw)
In-Reply-To: <87h6wpkrlq.fsf@web.de>

* Michael Heerdegen <michael_heerdegen@web.de> [2023-01-17 20:20]:
> But you might have learned that multiplication is repeated summation (I
> think I already gave this example a couple of times but never got a
> response):
> 
> 
>   2*9 = 9 + 9 (two summands)
>   1*9 = 9     (one summand)
>   0*9 = ???   (it's 0 at least)

and how do you use represent that in Emacs Lisp? Though we actually
speak of following

    * = 1

because it is absence of summands. Not presence.

> When it's allowed for `*' to handle cases that could be interpreted (!)
> as the sum of zero arguments, why should a _generalization_ of `+' not
> be allowed to?

Above sounds as capricious decision. I assume that Lisp makers who
decided that (*) ➜ 1 did not have capricious decision, but they had
something else in mind, something we did not yet mention here, and
that something is what I am searching.

> Note that adding things like Ferraris is only an _interpretation_ of
> a formula.  A product with zero factors might not have a useful
> direct interpretation in the real world, but complex numbers also
> don't have, and that doesn't mean that it can't be useful to extend
> the formalisms that once were _inspired_ by things in the real
> world.  What sum corresponds pi^2 to?

I don't really search for useful interpretation in real world, just in
Emacs Lisp or similar, why is it useful in Lisp?

Do you have mathematical exercise in Lisp that may demonstrate it
usefulness?

Is it only for representation purposes like Eduardo explained,
something like:

(* 2 2 2) ➜ 8
(* 2 2) ➜ 4
(* 2) ➜ 2
(*) ➜ 1

Do you think it is only for representation or consistency purposes? Or
there is some actual use?

> So what you fail to see is that not everything in maths can be
> directly demonstrated using apples and pears.

I don't fail to see that, because I know that 2 plus 2 is never 4,
that is just absolute representation, and in reality (almost) not
possible, as things like apples or Ferraris, chips, they are never
same, we have to imagine that one thing is same to other for
mathematics to work, as there is useful application of it. So no, that
is not problem.

What I do not see is why is it convenient in Lisp.

> But that doesn't mean that it's not worth to include these parts of
> maths in programming languages.

OK I understand people in Common Lisp included it, and Emacs Lisp has
it, and other Lisps. But why for example Emacs Lisp has (-) ➜ 0 but
other Lisps not?

Maybe in Emacs Lisp authors found some use for it?

Or do they include it just because? Just because set theory, blah
blah, so let us include it, but we see no reason for it. This is not
believable. I believe there is some practical reason behind it.

Reason that was not yet shown, but I feel it may be shown by somebody.

> If you are really doing maths, or are really working with sums in
> programming, you'll see why and where these convention make sense. 

I have no doubt for it. But show me use in Lisp as I do not ask about
outside theories, but why is it included in Lisp. Is there
example?

> And in programming, it's a bit like with everything new you learn:
> you don't miss it before you get to know it.

It still remains mystery.

> > What idea he has is that there must be 2 known factors for
> > multiplications and similar for addition.
> 
> That doesn't mean that it can't be _extended_.  Like the natural numbers
> can be extended to the whole numbers etc.  It's generalization and
> abstraction.  You don't learn all of that in elementary school.

Ok it has been extended. That is your conclusion. But why? Show me the use.

> > That there may be some convention is not excluded, and that there is
> > identity element in mathematics is fine, but even the page of identity
> > element does not speak of creation of identity elements, but of usage
> > of identity elements.
> 
> It's just not important enough, it's a little detail.  Like in Elisp.
> It might sound super important and big to you right now but we are
> speaking about a tiny corner case all the time.  We don't mention that
> (* 0 n) returns 0 in the docstring of `*', for example.

I do not see above as analogous. I wish though.

> > Then we have contradiction that description of functions `*' and `+'
> > and `-' does not speak of any sets or group theory. And we have people
> > speaking yes, group theory, sets. 
> >
> > But not description of relation from sets to Lisp function, why?
> 
> We have argument _lists_ that play the role of sets.
> 
> > I am asking why is it in (some) Lisps?
> 
> Because it's more convenient than raising an error.  Examples had been
> outlined in this thread.

OK, maybe that, I would like to understand if that was really the
reason of including it, the reason to minimize errors?

I remember keyword "variadic functions", and by you telling me that
reason is to minimize errors, then I searched and found following:

http://www.google.com/search?hl=en-UG&source=hp&biw=&bih=&q=reason+for+variadic+functions+in+lisp+%22%28*%29%22&iflsig=AK50M_UAAAAAY8bsWwouJNovTEERdNcNKZHzCAJ9q4qm&gbv=2&oq=reason+for+variadic+functions+in+lisp+%22%28*%29%22&gs_l=heirloom-hp.3..0i546l3j0i30i546.87530.93919.0.94212.43.40.0.1.1.1.283.4416.20j15j5.40.0....0...1ac.1.34.heirloom-hp..16.27.2252.UY2UeNCa7OY

I see one reference here:

Lots of Insipid, Stupid Parentheses | by Ronie Uliana | Medium:
https://ronie.medium.com/lots-of-insipid-stupid-parentheses-98f9b9510579

where it says:

"Variadic arguments are even more interesting when we don’t pass any argument, like this:

(+) <= this one gives us 0
(*) <= and this results in 1

Very handy because those are exactly the neutral elements for sum and
product."

But I can't see why is it handy, why it was added to Lisp to be
handy. I heard so far it is convenient, handy, but not why is it
convenient, no example where it shows its conveniency, and Picolisp
example shows that `apply' can work perfectly well even if (*) ➜ NIL

I can see here at this reference:

Lots of Insipid, Stupid Parentheses | by Ronie Uliana | Medium:
https://ronie.medium.com/lots-of-insipid-stupid-parentheses-98f9b9510579

> Variadic functions are functions that can take a variable number of
> arguments. In C programming, a variadic function adds flexibility to
> the program. It takes one fixed argument and then any number of
> arguments can be passed. The variadic function consists of at least
> one fixed variable and then an ellipsis(…) as the last parameter.

That gives me to think that the sole purpose of making (*) ➜ 1 work in
Lisp is to minimize errors, though I do not see the useful Lisp
expression where such error is minimized. I wish to find it. The only
useful case where I see that (*) will minimize errors is the function
itself, by writing "(*)" so in that case it minimizes errors, so that
demonstration is not enough.

Is there any other case or Lisp expression where one can see that (*)
is useful to minimize errors?

I can think that such case is maybe every day easy to find, but so far
none of participants mentioned it.


-- 
Jean

Take action in Free Software Foundation campaigns:
https://www.fsf.org/campaigns

In support of Richard M. Stallman
https://stallmansupport.org/



  parent reply	other threads:[~2023-01-17 18:04 UTC|newest]

Thread overview: 167+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-07 20:53 How to make M-x TAB not work on (interactive) declaration? Jean Louis
2023-01-07 21:11 ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-01-07 23:40   ` Jean Louis
2023-01-08  6:06 ` Eli Zaretskii
2023-01-08  6:19   ` Emanuel Berg
2023-01-09  4:49     ` Jean Louis
2023-01-09  6:26       ` algorithmic Lisp language (was: Re: How to make M-x TAB not work on (interactive) declaration?) Emanuel Berg
2023-01-09 19:30         ` Jean Louis
2023-01-09 19:32         ` Jean Louis
2023-01-08  6:21   ` How to make M-x TAB not work on (interactive) declaration? Jean Louis
2023-01-08  6:32     ` Emanuel Berg
2023-01-08 10:38     ` Eli Zaretskii
2023-01-08  8:34 ` Tassilo Horn
2023-01-08 11:01   ` Eli Zaretskii
2023-01-09 13:29     ` Tassilo Horn
2023-01-08 21:35   ` Jean Louis
2023-01-08 22:35     ` [External] : " Drew Adams
2023-01-09  0:24       ` Emanuel Berg
2023-01-09 19:47         ` Jean Louis
2023-01-10 23:28           ` Emanuel Berg
2023-01-13  6:21             ` (*)->1 Jean Louis
2023-01-14 12:03               ` (*)->1 Michael Heerdegen
2023-01-14 12:33                 ` (*)->1 Michael Heerdegen
2023-01-15 20:18           ` [External] : Re: How to make M-x TAB not work on (interactive) declaration? Rudolf Adamkovič
2023-01-15 20:57             ` Jean Louis
2023-01-15 22:33               ` Drew Adams
2023-01-15 23:10                 ` Emanuel Berg
2023-01-16 15:28                 ` Jean Louis
2023-01-16 17:07                   ` Drew Adams
2023-01-16 18:25                     ` Jean Louis
2023-01-17  2:20                       ` Drew Adams
2023-01-17  5:28                         ` tomas
2023-01-17 22:20                           ` Drew Adams
2023-01-18  5:14                             ` tomas
2023-01-18  5:26                               ` Emanuel Berg
2023-01-19 11:38                                 ` tomas
2023-01-19 11:51                                   ` Emanuel Berg
2023-01-21 14:05                                     ` tomas
2023-01-23 10:14                                       ` Robert Pluim
2023-01-23 16:44                                       ` Michael Heerdegen
2023-01-23 19:28                                         ` tomas
2023-01-18 17:27                               ` Drew Adams
2023-01-18 17:32                                 ` tomas
2023-01-18 14:32                             ` Jean Louis
2023-01-18 20:36                               ` Drew Adams
2023-01-19  9:05                                 ` (*) -> 1 Jean Louis
2023-01-19  9:41                                   ` Yuri Khan
2023-01-19 12:52                                   ` Anders Munch
2023-01-17  5:35                         ` [External] : Re: How to make M-x TAB not work on (interactive) declaration? Jean Louis
2023-01-17 15:59                           ` Yuri Khan
2023-01-17 16:42                             ` Jean Louis
2023-01-17 16:05                           ` Michael Heerdegen
2023-01-17 16:17                             ` Yuri Khan
2023-01-17 16:25                             ` tomas
2023-01-17 16:55                             ` (*) -> 1 Jean Louis
2023-01-17 17:52                               ` Michael Heerdegen
2023-01-17 18:11                                 ` Óscar Fuentes
2023-01-17 18:40                                   ` Jean Louis
2023-01-17 19:04                                     ` Óscar Fuentes
2023-01-18 13:15                                       ` Jean Louis
2023-01-18 14:37                                         ` Óscar Fuentes
2023-01-18 18:17                                         ` [External] : " Drew Adams
2023-01-17 19:35                                     ` Michael Heerdegen
2023-01-17 21:12                                   ` Michael Heerdegen
2023-01-17 22:01                                     ` Óscar Fuentes
2023-01-17 23:38                                       ` Michael Heerdegen
2023-01-18  7:50                                         ` Óscar Fuentes
2023-01-18  8:37                                           ` tomas
2023-01-18 12:46                                             ` Óscar Fuentes
2023-01-18 13:44                                               ` Michael Heerdegen
2023-01-18 14:07                                                 ` Óscar Fuentes
2023-01-18 16:19                                                   ` Andreas Eder
2023-01-18 17:14                                                     ` Óscar Fuentes
2023-01-19  8:37                                                   ` Jean Louis
2023-01-17 18:18                                 ` Jean Louis
2023-01-17 11:52                         ` [External] : Re: How to make M-x TAB not work on (interactive) declaration? Michael Heerdegen
2023-01-15 21:08             ` Jean Louis
2023-01-16  5:02               ` Emanuel Berg
2023-01-16  5:38               ` tomas
2023-01-16 10:10                 ` Jean Louis
2023-01-16 10:41                   ` Yuri Khan
2023-01-16 15:26                     ` Jean Louis
2023-01-17  4:06                 ` Emanuel Berg
2023-01-17 14:00                   ` tomas
2023-01-17 22:43                     ` Emanuel Berg
2023-01-17 16:25                 ` Nick Dokos
2023-01-17 17:19                   ` Jean Louis
2023-02-11  4:38                     ` Ruijie Yu via Users list for the GNU Emacs text editor
2023-02-11 10:54                       ` Jean Louis
2023-01-17 17:41                   ` Nick Dokos
2023-01-16  7:55               ` Yuri Khan
2023-01-16 10:16                 ` Jean Louis
2023-01-16 10:37                   ` Yuri Khan
2023-01-16 15:35                     ` Jean Louis
2023-01-16 15:59                       ` Yuri Khan
2023-01-16 16:14                         ` Jean Louis
2023-01-16 16:47                           ` tomas
2023-01-16 17:07                           ` Drew Adams
2023-01-16 18:41                             ` Jean Louis
2023-01-16 10:51                   ` Anders Munch
2023-01-16 15:38                     ` Jean Louis
2023-01-16 17:40                       ` Andreas Eder
2023-01-16 18:17                         ` tomas
2023-01-16 18:55                           ` Jean Louis
2023-01-16 19:14                             ` tomas
2023-01-16 18:46                         ` Jean Louis
2023-01-17  2:37                           ` Eduardo Ochs
2023-01-17  5:46                             ` (*) -> 1 Jean Louis
2023-01-17 15:56                               ` Michael Heerdegen
2023-01-17 16:29                                 ` Jean Louis
2023-01-17 16:43                                   ` tomas
2023-01-17 17:25                                     ` Jean Louis
2023-01-17 19:11                                       ` Nick Dokos
2023-01-17 17:17                                   ` Michael Heerdegen
2023-01-17 17:26                                     ` Jean Louis
2023-01-17 18:46                                       ` Michael Heerdegen
2023-01-17 18:51                                         ` Jean Louis
2023-01-17 18:04                                     ` Jean Louis [this message]
2023-01-17 18:28                                       ` Eduardo Ochs
2023-01-17 19:18                                       ` Michael Heerdegen
2023-01-18 12:27                                         ` Jean Louis
2023-01-18 13:37                                           ` Michael Heerdegen
2023-01-19  8:20                                             ` Jean Louis
2023-01-19 10:06                                               ` Tassilo Horn
2023-01-19 13:43                                               ` Michael Heerdegen
2023-01-19 14:42                                                 ` Jean Louis
2023-01-19 15:27                                                   ` tomas
2023-01-18 13:57                                           ` Óscar Fuentes
2023-01-19  8:32                                             ` Jean Louis
2023-01-19 16:51                                               ` Óscar Fuentes
2023-01-20  8:01                                                 ` Jean Louis
2023-01-18 14:25                                           ` Michael Heerdegen
2023-01-19  8:34                                             ` Jean Louis
2023-01-19 13:54                                               ` Michael Heerdegen
2023-01-19 14:54                                                 ` Jean Louis
2023-01-19 15:19                                                   ` Tassilo Horn
2023-01-20  7:05                                                     ` Jean Louis
2023-01-20  8:52                                                       ` Tassilo Horn
2023-01-20 12:46                                                         ` Jean Louis
2023-01-20 13:02                                                           ` Tassilo Horn
2023-01-20 16:06                                                             ` Jean Louis
2023-01-21  8:19                                                               ` Tassilo Horn
2023-01-22  4:30                                                                 ` Emanuel Berg
2023-01-22  6:55                                                                   ` Jean Louis
2023-01-22 10:56                                                                     ` Emanuel Berg
2023-01-23  3:40                                                                       ` [External] : " Drew Adams
2023-01-22 14:34                                                                   ` Akib Azmain Turja
2023-01-23  2:23                                                                     ` Emanuel Berg
2023-01-23  5:37                                                                     ` Jean Louis
2023-01-23  5:55                                                                     ` Jean Louis
2023-01-24  2:33                                                                       ` Emanuel Berg
2023-01-19 15:46                                                   ` Michael Heerdegen
2023-01-19 17:38                                                   ` Dr Rainer Woitok
2023-01-20  7:31                                                     ` Jean Louis
2023-01-20 11:49                                                       ` Dr Rainer Woitok
2023-01-19 14:54                                                 ` Jean Louis
2023-01-19 17:44                                                 ` [External] : " Drew Adams
2023-01-19 21:29                                                   ` Michael Heerdegen
2023-01-20  7:40                                                     ` Jean Louis
2023-01-20  8:47                                                       ` Emanuel Berg
2023-01-20  7:33                                                   ` Jean Louis
2023-01-18  9:02                                 ` Anders Munch
2023-01-18 10:49                                   ` Michael Heerdegen
2023-01-18 11:10                                     ` Emanuel Berg
2023-01-18 12:48                                   ` Eli Zaretskii
2023-01-18 14:29                                     ` Michael Heerdegen
     [not found]                           ` <87k01lica7.fsf@eder.anydns.info>
2023-01-17 16:04                             ` Jean Louis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y8bjItPWgBLLdR9s@protected.localdomain \
    --to=bugs@gnu.support \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.