unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie<none@example.invalid>
Subject: Re: simple... bug?
Date: Tue, 14 Oct 2003 08:46:32 +0000	[thread overview]
Message-ID: <85dgmb.ac.ln@acm.acm> (raw)
In-Reply-To: mailman.1649.1066115958.21628.help-gnu-emacs@gnu.org

Joe Corneli <jcorneli@math.utexas.edu> 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").

       reply	other threads:[~2003-10-14  8:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.1649.1066115958.21628.help-gnu-emacs@gnu.org>
2003-10-14  8:46 ` Alan Mackenzie [this message]
2003-10-14  9:12 ` simple... bug? Joakim Hove
2003-10-15  7:49 ` David Vanderschel
2003-10-14  7:17 Joe Corneli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=85dgmb.ac.ln@acm.acm \
    --to=none@example.invalid \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).