From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: simple... bug? Date: Tue, 14 Oct 2003 08:46:32 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <85dgmb.ac.ln@acm.acm> References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1066122119 14360 80.91.224.253 (14 Oct 2003 09:01:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 14 Oct 2003 09:01:59 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Oct 14 11:01:58 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A9L41-0002mE-00 for ; Tue, 14 Oct 2003 11:01:58 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1A9L2y-0003z8-1t for geh-help-gnu-emacs@m.gmane.org; Tue, 14 Oct 2003 05:00:52 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newspump.monmouth.com!newspeer.monmouth.com!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!peernews3.colt.net!newsfeed.stueberl.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1066121279 93316 193.149.49.134 (14 Oct 2003 08:47:59 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 14 Oct 2003 08:47:59 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:117241 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:13170 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:13170 Joe Corneli wrote on Tue, 14 Oct 2003 02:17:11 -0500: > (defun squares (list-of-numbers) > (let ((list-of-squares nil) > (i 0) > (L (length list-of-numbers))) > (while (< i L) > (setq list-of-squares (append list-of-squares > (list (* (nth i list-of-numbers) > (nth i > list-of-numbers))))) > (setq i (1+ i)))) > list-of-squares) > For > (squares '(2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 > 83 89 97)) > I get > * > (4 9 9 25 49 121 169 289 361 529 841 961 1369 1681 1849 2209 2809 3481 > 3721 4489 5041 5329 6241 6889 7921 9409) > Emacs is 21.3.1 > OS is Mac OS X 10.3 > Am I making some _extremely_ subtle mistake? What on earth is the value "list-of-squares" that you're returning? It's not the one you bound in the "let" form. :-) Hey, I do things like this too. It makes me feel really stupid. Something I've done approximately three times in the last three months is to write this form: (\= (point) here) It didn't do what I wanted. But thank goodness for edebug. :-( > Joe -- Alan Mackenzie (Munich, Germany) Email: aacm@muuc.dee; to decode, wherever there is a repeated letter (like "aa"), remove half of them (leaving, say, "a").