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: Tue, 17 Jan 2023 21:18:20 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Michael Heerdegen <michael_heerdegen@web.de> [2023-01-17 20:54]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > (*) ➜ 1
> > (*) ➜ 1
> >
> > We will get total of 2 Ferraris out of nothing.
> 
> And with (concat) we get an empty string in the garage out of
> nothing.

And why?

(concat) ➜ ""

Is it mathematical convention?

Is it maybe just programming convention to minimize errors like we
mentioned it?

In case of `concat' I can understand that (concat nil) ➜ "" is useful,
that is clear. Then in that sense I can also understand (concat) ➜ ""
being useful as function need not be programmed to say there are no
arguments, but simply accepts any arguments and at least delivers ""
for empty list, even though for list it gives error (concat '("ok"
"there"))

So my understanding that it is for purpose of minimizing errors is in
doubt, as for empty list it gives string, but for non-empty list it
can't handle it.

Then is hard to understand why is it convenient this:
(-) ➜ 0
or
(+) ➜ 0

but not this, where:

(1-) yields with error, and why not -1?
(1+) yields with error, and why not 1?

I read in manual:

 -- Function: logior &rest ints-or-markers
     This function returns the bitwise inclusive OR of its arguments:
     the Nth bit is 1 in the result if, and only if, the Nth bit is 1 in
     at least one of the arguments.  If there are no arguments, the
     result is 0, which is an identity element for this operation.  If
     ‘logior’ is passed just one argument, it returns that argument.

but nowhere else is "identity element" mentioned, so I still look for
reasons why is identity element returned.

To minimize the error? For that information to be acceptable I would
like to find example of minimization of error. It seem hard to find
it, even though it is attributed as being "handy" and "convenient" on
Internet. 

-- 
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]