bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#23495: byte-compile-file return t when there is "XXX can't use lexic


From: Michael Heerdegen
Subject: bug#23495: byte-compile-file return t when there is "XXX can't use lexical var" error
Date: Tue, 10 May 2016 20:23:43 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.93 (gnu/linux)

Yuta Yamada <sleepboy.zzz@gmail.com> writes:

> ---- code ----
> ;; -*- lexical-binding: t; -*-
> (defun foo ()
>   (let* ((a nil))
>     (add-to-list 'a "foo")))
>
> (provide 'foo)
> ---- code end ----
>
> In *Compile-Log* buffer, I got:
>
> ---- log ----
> Compiling 
> /home/uta/local/vcs/github.com/yuutayamada/emacs.d/elisp/self/hoge/foo.el...
>
> In foo:
> foo.el:6:13:Error: `add-to-list' can't use lexical var `a'; use `push' or
>     `cl-pushnew'
> ---- log end ----
>
> But actually `byte-compile-file' return `t'.

AFAICT technically this is only a warning (displayed with
`display-warning' and level :error).  So compiling does indeed succeed I
think.

See the compiler macro defined in the defun of `add-to-list' for
internals.



Michael.





reply via email to

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