help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (*) -> 1


From: Jean Louis
Subject: Re: (*) -> 1
Date: Wed, 18 Jan 2023 16:15:53 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Óscar Fuentes <ofv@wanadoo.es> [2023-01-17 22:06]:
> I think your confusion comes from an assumption that everybody else on
> this conversation is blind to, in the sense that nobody (I didn't read
> most of the thread, though) didn't explicitly stated it:
> 
> + in Elisp is not the "plus" operation that we all know (the same C uses
> and school children use.) + in Elisp is not the binary operation, it is
> the summatory operator, which takes a list of arguments and returns the
> sum of them all.
> 
> In that sense, maybe you can see more naturally that "the sum of nothing
> is zero." This makes possible to apply the + (summatory!) operator to
> any list of numbers, including the empty list.

Do you mean with "C uses" that "C language uses"?

> The language designers pursue convenience and consistency and take
> decisions based on some sense of what is "natural". Hence if we see as
> reasonable that the summatory of an empty list of arguments is zero (the
> identity element for summation) and we want for as much operators as
> possible to work on empty lists, we also choose to return the empty
> element for the underlaying operation of the operator on those cases.
> There are more supporting "reasons" for doing that, such as:

OK I understand it as hypothesis, though is there reference that it
was that way?

Still missing the use case.

I see it this way:

- For this I don't see clearly why we are supposed to imagine 1 when
  two factors are required for multiplication. I would rather like
  error for missing argument. 

(* 2) ➜ 2

- Following makes no sense at all if we can't find actual usage for
  it.

(*) ➜ 1

When we talk of identity elements, then I read here:
https://en.wikipedia.org/wiki/Additive_identity

In mathematics, the additive identity of a set that is equipped with
the operation of addition is an element which, when added to any
element x in the set, yields x.

But we have here case of "not adding additive identity", because is
not there: (+)

I would say that (+ 2 0) ➜ 2 demonstrates the additive identity. It
has to be added to other elements to be additive identity, it does not
spring out of nothing.  In that reference they speak of showing the
identity first, not "without showing it at all", if nothing is there,
then nothing was subject of addition, and so there is no result with
additive identity. 

Similarly see here: https://brilliant.org/wiki/identity-element/
where it says: "An identity element in a set is an element that is
special with respect to a binary operation on the set: when an
identity element is paired with any element via the operation, it
returns that element"

So there must be elements in first place to say that something is
identity element. 

We speak of absence of any elements. One less important question is
why author of Lisp decided to yield 1 for (*), more important
questions is of the use of it. 

Practically I found one use during sketching stage of programs, just
to write it there as preliminary placeholders, like:

(* (*) (*)) then in few minutes it is then expanded to:

(* (* specific-gravity cubic-meter) (* ))

then to be expanded to:

(* (* specific-gravity cubic-meter) (* excavator-cycles hour))

Apart from few references on Internet we talked about, I cannot find
uses for it, or purpose, it seem difficult.

-- 
Jean

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

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]