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: Thu, 19 Jan 2023 11:32:22 +0300
User-agent: Mutt/2.2.9+54 (af2080d) (2022-11-21)

* Óscar Fuentes <ofv@wanadoo.es> [2023-01-18 16:58]:
> Jean Louis <bugs@gnu.support> writes:
> 
> > * Michael Heerdegen <michael_heerdegen@web.de> [2023-01-17 22:20]:
> >> The question of use is a valid one, we missed to answer it yet.  It
> >> wasn't clear to me that this was part of what you are asking for.
> >
> > Yes, that one. 
> >
> > Why authors decided to have (*) ➜ 1 which in case of me who could
> > delete some argument like from (* tonnes quantity) I could by mistake
> > delete "tonnes and quantity" and result of (*) would not be detected
> > because there is no error
> 
> Throwing an error on this case is a reasonable possibility for the
> language designers, but instead they decided to extend * to zero and one
> arguments. Why? because it is convenient, because it makes possible to
> do things like (apply '* some-list) without caring about how many
> elements some-list has, which is handy when some-list comes from a place
> you don't control. 

That explanation sounds like neglect in programming. I have mentioned
that PicoLisp can `apply' with (*) yielding NIL. Try it out.

~$ pil
: (*)
-> NIL
: (+)
-> NIL
: (apply '* '(2 3))
-> 6

it means it is not really to give relief to other functions. And there
is nothing wrong for apply to yell the error when arguments are
missing to the function.

If you have some reference to that reasoning that (*) is related to
`apply' from language designer, let me know.

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