emacs-tangents
[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: Fri, 20 Jan 2023 15:46:04 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Tassilo Horn <tsdh@gnu.org> [2023-01-20 12:12]:
> Jean Louis <bugs@gnu.support> writes:
> 
> >> Gosh, Jean, of course nobody would literally write (*) but (apply #'*
> >> ...), and you'll find occurrences in emacs:
> >
> > That has been said that is not necessarily problem or reason. 
> 
> I don't understand that sentence.
> 
> > Did you see reference to PicoLisp?
> 
> 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:07 <jmarciano> may somebody experienced with PicoLisp tell me if
                  (*) returning NIL in PicoLisp is obstacle or
                  feature? It is because I am trying to find use of
                  the function in other Lisp where (*) ➜ 1,
                  however, apparently, the use for it does not
                  exist. I have found PicoLisp returning NIL on
                  empty (*)
15:08 <jmarciano> Was author of PicoLisp aware that other Lisp
                  return (*) ➜ 1 at time of making it? 
15:08 <jmarciano> And what was decision of author, reasoning, why
                  not to include it?
15:08 <abu[m]> Hi jmarciano! Well, I'm the author.
15:08 <jmarciano> Which reasoning I favor, as I rather like NIL
                  returned, rather than finding out where did I
                  miss to place the numbers.
15:09 <jmarciano> Nice to meet you. 
15:09 <abu[m]> It is a "feature" that NIL propagates through
               arithmetics
15:09 <jmarciano> How does it help instead of providing identity
                  elements?
15:09 <abu[m]> (*) especially was not contemplated though, it is a
               pretty useless call
15:10 <abu[m]> but (+ 3 NIL) -> NIL was desired
15:10 <jmarciano> and why?
15:11 <jmarciano> Were you aware at the time of authoring it, that
                  other Lisp was giving (*) ➜ 1 
15:11 <abu[m]> It is very convenient. I think I have hundreds of
               cases where I rely on getting NIL when not all
               argumets are ready (yet)
15:11 <abu[m]> very common in valuen from GUI
15:11 <abu[m]> A was not aware
15:11 <abu[m]> and never cared about other Lisps
15:12 <jmarciano> (*) ➜ 1, (+) ➜ 0, (-) ➜ 0, that is in Emacs Lisp
15:12 <abu[m]> Note that PicoLisp is very different from most Lisps
               anywad
15:12 <abu[m]> What is a call like (*) useful for?

As you see, author also asked naturally why is it useful.

> 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. I would not like forgetting some arguments and getting (*) ➜ 1
when instead I had to write something like (* a b). Even this case is
rare I find error better, or NIL, as with NIL I can't to other
mathematical operations, I will get error:

(* nil 2) will not work, and that will help me put attention on
it. Similarly (* (*) 2) would raise error putting my attention that I
forgot some arguments, then I would correct and write (* (* a b) 2).

Something is maybe "correct" in somebody's opionion but have no
practical use. And question was not what somebody considers correct,
but what is the practical use of it.

There are X mathematical subjects that are not injected in Emacs Lisp
functions just to be discovered they exist for themselves only.

Functions should serve a purpose, not only representation purpose of
some mathematica subject.

Function `*' to me should serve purpose of multiplication, not
representation of set theory or identity elements, UNLESS those
identity elements are useful somewhere.

And I asked for case where it is useful.

There is so far none case found, apart from mathematical
representation for those people who like to talk about it.

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