Why in lisp (Emacs Lisp and Scheme as I know) construction like (*) returns 1?
What I multiply here? How can I call this function * without arguments?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is a mathematical convention: the product of an empty sequence of numbers is one, by definition; note that one is the identity element for multiplication (1×a = a×1 = a). This is convenient because you can call
*with a variable number of arguments without worrying about the case where there are no arguments present.Similarly, the sum of an empty sequence of numbers is zero, the identity element for addition. Try issuing
(+)at your Lisp prompt.