Hi.
In some cases (example below) (DECLARE (IGNORE ...))
seems to be 'inactive'.
(funcall
(compile
nil
'(lambda ()
(destructuring-bind (x x x x a x b . x) (list 1 2 3 5 6 7 8 9 10)
(declare (ignore x))
(list a b)))))
result:
[.....]
; (DESTRUCTURING-BIND
; (X X X X A ...)
; (LIST 1 2 3 5 ...)
; (DECLARE #)
; (LIST A B))
; --> LET LET*
; ==>
; (LET* (# # # # # ...)
; (DECLARE #)
; (LIST A B))
; Note: Variable X defined but never used.
; ; [Last message occurs 5 times]
[.....]
(6 8)
Any ideas how to fix this ? (CLISP, for example, can handle this case).
Regards, Szymon.
From: Tim Bradshaw
Subject: Re: problem with (DECLARE (IGNORE ...)) in CMUCL.
Date:
Message-ID: <ey3brenx0ib.fsf@cley.com>
* Szymon wrote:
> Hi.
> In some cases (example below) (DECLARE (IGNORE ...))
> seems to be 'inactive'.
> [...]
> Any ideas how to fix this ? (CLISP, for example, can handle this case).
Well, I think this sort of thing is probably not very well defined.
What you're doing is more-or-less equivalent to something like
(let ((x 1)
(x 2))
(declare (ignore x))
...)
or perhaps
(let* ((x 1)
(x 2))
(declare (ignore x))
...)
And I'm not at all clear that the IGNORE declaration *should* affect
all the bindings of X. I'd *want* a warning in these cases!
--tim
Tim Bradshaw <ยทยทยท@cley.com> writes:
> * Szymon wrote:
> > Hi.
>
> > In some cases (example below) (DECLARE (IGNORE ...))
> > seems to be 'inactive'.
>
> > [...]
>
> > Any ideas how to fix this ? (CLISP, for example, can handle this case).
>
> Well, I think this sort of thing is probably not very well defined.
> What you're doing is more-or-less equivalent to something like
>
> (let ((x 1)
> (x 2))
> (declare (ignore x))
> ...)
This form in not valid (?) (more-or-less eql to (LAMBDA (X X))).
> or perhaps
>
> (let* ((x 1)
> (x 2))
> (declare (ignore x))
> ...)
>
> And I'm not at all clear that the IGNORE declaration *should* affect
> all the bindings of X. I'd *want* a warning in these cases!
Ok. If you want warning -- I want it too :)
Regards, Szymon.