[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: false warnings when compiling with lexical-binding and cl-lib.
From: |
Stefan Monnier |
Subject: |
Re: false warnings when compiling with lexical-binding and cl-lib. |
Date: |
Sun, 24 Nov 2013 13:08:35 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) |
>> Also the warning is only at compile time, should we return an error on
>> evaluation ?
I don't see why we should bother with an error.
(let* ((a 1) (a 2)) ...)
is not very useful, but it's not an error. The warning we currently
have is not perfect because it applies to the post-macroexpansion code,
so the user may not immediately understand what's going on, but your
suggested patch has the following downsides:
- it breaks previously working code.
- it does not tell you where (approximate line number) the error is located.
So if we want to improve on the current code, I think rather than
`cl-assert' we should use macroexp--warn-and-return (grep for it to see
sample uses). But the patch won't be as trivial.
Stefan