emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Warning: `mapcar' called for effect; use `mapc' or `dolist'


From: Glenn Morris
Subject: Re: Warning: `mapcar' called for effect; use `mapc' or `dolist'
Date: Wed, 31 Oct 2007 17:19:23 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Richard Stallman wrote:

> If the byte compiler warns about that case, it is being too
> ambitious. Thus, if the value of an expression is stored into a
> variable, the compiler should consider the value "used".
>
> So if this warning really happens, it is a bug. Can it be
> reproduced?

There's nothing to worry about AFAICS:

(let ((foo (mapcar (lambda (e) e) '(a b c)))))     ; warning

(let ((foo (mapcar (lambda (e) e) '(a b c))))      ; no warning
  foo)                            

(defvar foo nil)
(defun foo-func ()
  foo)
(let ((foo (mapcar (lambda (e) e) '(a b c))))      ; no warning
  (foo-func))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]