From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: MON KEY Newsgroups: gmane.emacs.devel Subject: unexpected result with mapc of lambda form inside catch/throw Date: Fri, 26 Nov 2010 16:41:21 -0500 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: dough.gmane.org 1290807696 14211 80.91.229.12 (26 Nov 2010 21:41:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 26 Nov 2010 21:41:36 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Nov 26 22:41:33 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PM62s-0004F7-Ok for ged-emacs-devel@m.gmane.org; Fri, 26 Nov 2010 22:41:30 +0100 Original-Received: from localhost ([127.0.0.1]:42547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PM62r-0004oH-SU for ged-emacs-devel@m.gmane.org; Fri, 26 Nov 2010 16:41:29 -0500 Original-Received: from [140.186.70.92] (port=59166 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PM62m-0004o2-TF for emacs-devel@gnu.org; Fri, 26 Nov 2010 16:41:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PM62l-0003ld-V1 for emacs-devel@gnu.org; Fri, 26 Nov 2010 16:41:24 -0500 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:57697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PM62l-0003lD-QZ for emacs-devel@gnu.org; Fri, 26 Nov 2010 16:41:23 -0500 Original-Received: by wwj40 with SMTP id 40so78647wwj.30 for ; Fri, 26 Nov 2010 13:41:21 -0800 (PST) Original-Received: by 10.216.159.195 with SMTP id s45mr2489591wek.43.1290807681728; Fri, 26 Nov 2010 13:41:21 -0800 (PST) Original-Received: by 10.216.70.212 with HTTP; Fri, 26 Nov 2010 13:41:21 -0800 (PST) X-Google-Sender-Auth: 6lCeF6rNq-jQ0hq8DPEkvzHIpxc X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:133179 Archived-At: Can someone please explain why the following expression's `lambda' form returns 32 when mapc'ing its arg X? I am expecting that X successively evaluate to: 59, 59, and 91 Instead, with the first invocation of the `lambda' form X is 32. Is this an error? If not, why not? (emacs-version) ; => "GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.0) of 2010-05-10" emacs -Q (setq tt--global-var ";;; ") (let* ((tt--global-var ";;[ ") (tt--global-var-REAL-DEFAULT ";;; ") (sub-str-pfx (reverse (cdr (reverse (append tt--global-var nil)))))) ;; At this point sub-str-pfx is '(59 59 91) (unless (catch 'prefix-not-same (equal tt--global-var (concat (mapc #'(lambda (x) (when (and (= (car sub-str-pfx) 59) (= x 32)) (momentary-string-display (format (concat "\nInside lambda form arg X is `mapc'd over the range (59 59 91)\n" "At this point X _should be_ %d, but elisp returns %d, why?") (car sub-str-pfx) x) (point))) (unless (= x (car sub-str-pfx)) (throw 'prefix-not-same (progn (momentary-string-display (format "prefix chars not identical, failed-at: %S" (char-to-string x)) (point)) nil))) sub-str-pfx) " ")))) (setq tt--global-var tt--global-var-REAL-DEFAULT) (equal tt--global-var ";;; "))) -- /s_P\