From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hadron Newsgroups: gmane.emacs.help Subject: Re: lisp question Date: Mon, 30 Apr 2007 01:06:04 +0200 Message-ID: <87bqh6eq77.fsf@gmail.com> References: <871wi385na.fsf@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1177889749 11984 80.91.229.12 (29 Apr 2007 23:35:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 Apr 2007 23:35:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 30 01:35:39 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HiIva-0000sl-Hw for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Apr 2007 01:35:38 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HiJ1h-00017p-Sx for geh-help-gnu-emacs@m.gmane.org; Sun, 29 Apr 2007 19:41:57 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 56 Original-X-Trace: individual.net OHfUU3JKiQ83H3y3w4UfiwCruAn1N0A22n/RGRADXqORMLjWHm X-Orig-Path: news.individual.net!news X-Face: 2h#||Cd#d%F*NCm59[_6/{1a@jy%; |j>{D~4^gKg(^i%7j0IK?+,/GmW&:CD5fEKb_! User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.99 (gnu/linux) Cancel-Lock: sha1:1zUEgk+2aKTnR7tvWocjI0s1i3I= Original-Xref: shelby.stanford.edu gnu.emacs.help:147772 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:43375 Archived-At: Barry Margolin writes: > In article <871wi385na.fsf@gmail.com>, Hadron > wrote: > >> from the lisp tutorial which comes with emacs 22: >> >> ,---- >> | 1.8.3 Variable Number of Arguments >> | ---------------------------------- >> | >> | Some functions, such as `concat', `+' or `*', take any number of >> | arguments. (The `*' is the symbol for multiplication.) This can be >> | seen by evaluating each of the following expressions in the usual way. >> | What you will see in the echo area is printed in this text after `=>', >> | which you may read as `evaluates to'. >> | >> | In the first set, the functions have no arguments: >> | >> | (+) => 0 >> | >> | (*) => 1 >> | >> | In this set, the functions have one argument each: >> | >> | (+ 3) => 3 >> | >> | (* 3) => 3 >> | >> | In this set, the functions have three arguments each: >> | >> | (+ 3 4 5) => 12 >> | >> | (* 3 4 5) => 60 >> `---- >> >> It kind of glosses over sections (1) and (2). >> >> Why do (*) and (* 3) evaluate to 1? > > (* 3) evaluates to 3, not 1. Sorry, yes. > > With associative functions, calling them with no arguments returns the > identity value for that function. This maintains the equivalence that > > ( ) == ( ( ) ( )) > > for any partitioning of the original arguments, including part1 or part2 > being empty. E.g. > > (* 3 4 5) = (* (* 3) (* 4 5)) = (* (*) (* 3 4 5)) All clear. Thanks.