GNU bug report logs -
#11938
24.1.50; Some not so useful CL related byte compiler warnings
Previous Next
Reported by: michael_heerdegen <at> web.de
Date: Fri, 13 Jul 2012 18:06:02 UTC
Severity: normal
Found in version 24.1.50
Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 11938 in the body.
You can then email your comments to 11938 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11938
; Package
emacs
.
(Fri, 13 Jul 2012 18:06:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
michael_heerdegen <at> web.de
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Fri, 13 Jul 2012 18:06:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi,
I create an example file with the following content:
(eval-when-compile
(require 'cl))
(defvar my-holiday-alist
'((2012 . ((( 1 1) . "New Year")))))
(defun* my-holidayp (&optional date no-warn-if-no-info)
(save-excursion
(progv '(a b year) date
(cdr (assoc (list a b)
(cdr (or (assoc year my-holiday-alist)
(prog1 nil ;always return nil
(push (cons year ()) my-holiday-alist) ;; --> Warn only one time
(unless no-warn-if-no-info
(ding)
(message "Note: No holiday info for %s in `my-holiday-alist'." year)
(sit-for 3))))))))))
(labels ((fac (x) (if (< x 2) 1 (* x (fac (1- x))))))
(defun test () (fac 5)))
If I byte compile it, I get the following warnings:
progv-bug.el:7:37:Warning: global/dynamic var `body' lacks a prefix
progv-bug.el:10:25:Warning: reference to free variable `a'
progv-bug.el:10:27:Warning: reference to free variable `b'
progv-bug.el:11:35:Warning: reference to free variable `year'
progv-bug.el:19:1:Warning: `labels' is an obsolete function (as of 24.2); use
`(quote cl-labels)' instead.
In detail:
progv-bug.el:7:37:Warning: global/dynamic var `body' lacks a prefix
Dunno what that means, the code doesn't include such a variable.
progv-bug.el:10:25:Warning: reference to free variable `a'
progv-bug.el:10:27:Warning: reference to free variable `b'
progv-bug.el:11:35:Warning: reference to free variable `year'
Not very useful, since the variables' values are never looked up
before they are bound, but ok, I can live with it.
progv-bug.el:19:1:Warning: `labels' is an obsolete function (as of 24.2); use
`(quote cl-labels)' instead.
What does `(quote cl-labels)' mean? I guess this should be just
`cl-labels'.
Thanks,
Michael.
In GNU Emacs 24.1.50.1 (i486-pc-linux-gnu, GTK+ Version 3.4.2)
of 2012-07-12 on keller, modified by Debian
(emacs-snapshot package, version 2:20120712-1)
Windowing system distributor `The X.Org Foundation', version 11.0.11201902
Configured using:
`configure '--build' 'i486-linux-gnu' '--host' 'i486-linux-gnu'
'--prefix=/usr' '--sharedstatedir=/var/lib' '--libexecdir=/usr/lib'
'--localstatedir=/var' '--infodir=/usr/share/info'
'--mandir=/usr/share/man' '--with-pop=yes'
'--enable-locallisppath=/etc/emacs-snapshot:/etc/emacs:/usr/local/share/emacs/24.1.50/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.1.50/site-lisp:/usr/share/emacs/site-lisp'
'--without-compress-info' '--with-crt-dir=/usr/lib/i386-linux-gnu/'
'--with-x=yes' '--with-x-toolkit=gtk3' '--with-imagemagick=yes'
'build_alias=i486-linux-gnu' 'host_alias=i486-linux-gnu'
'CFLAGS=-DDEBIAN -DSITELOAD_PURESIZE_EXTRA=5000 -g -O2' 'LDFLAGS=-g
-Wl,--as-needed -znocombreloc' 'CPPFLAGS=-D_FORTIFY_SOURCE=2''
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11938
; Package
emacs
.
(Fri, 13 Jul 2012 18:25:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 11938 <at> debbugs.gnu.org (full text, mbox):
Michael Heerdegen <michael_heerdegen <at> web.de> writes:
> progv-bug.el:19:1:Warning: `labels' is an obsolete function (as of 24.2); use
> `(quote cl-labels)' instead.
>
> What does `(quote cl-labels)' mean? I guess this should be just
> `cl-labels'.
Fixed.
Andreas.
--
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
bug closed, send any further explanations to
11938 <at> debbugs.gnu.org and michael_heerdegen <at> web.de
Request was from
Stefan Monnier <monnier <at> IRO.UMontreal.CA>
to
control <at> debbugs.gnu.org
.
(Tue, 17 Jul 2012 12:53:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11938
; Package
emacs
.
(Wed, 18 Jul 2012 10:32:02 GMT)
Full text and
rfc822 format available.
Message #13 received at 11938 <at> debbugs.gnu.org (full text, mbox):
> If I byte compile it, I get the following warnings:
> progv-bug.el:7:37:Warning: global/dynamic var `body' lacks a prefix
> progv-bug.el:10:25:Warning: reference to free variable `a'
> progv-bug.el:10:27:Warning: reference to free variable `b'
> progv-bug.el:11:35:Warning: reference to free variable `year'
> progv-bug.el:19:1:Warning: `labels' is an obsolete function (as of 24.2); use
> `(quote cl-labels)' instead.
Yay!! So there are progv users after all! Amazing!
> In detail:
> progv-bug.el:7:37:Warning: global/dynamic var `body' lacks a prefix
> Dunno what that means, the code doesn't include such a variable.
Yes, it's a bug of my new progv code, which introduces this var.
Should be fixed now, thank you.
> progv-bug.el:10:25:Warning: reference to free variable `a'
> progv-bug.el:10:27:Warning: reference to free variable `b'
> progv-bug.el:11:35:Warning: reference to free variable `year'
> Not very useful, since the variables' values are never looked up
> before they are bound, but ok, I can live with it.
Yes, I think these warnings were already present with Emacs-24.1's
version of progv.
I'm curious, actually. What does Common-Lisp do with something like:
(let ((a 2)) (progv '(a b) '(1 2) a))
does it return 2 (the value of the lexically-scoped var `a') or 1?
If it should return 1, what about:
(let ((a 2)) (progv '(b) '(1) a))
In any case, for all uses of progv where the first arg is a constant,
you'd be much better off using pcase-let (or destructuring-bind or
multiple-value-bind).
So maybe you're not a user of progv after all.
> progv-bug.el:19:1:Warning: `labels' is an obsolete function (as of 24.2); use
> `(quote cl-labels)' instead.
> What does `(quote cl-labels)' mean? I guess this should be just
> `cl-labels'.
Indeed, that was a copy&paste typo, thank you for catching it,
Stefan
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#11938
; Package
emacs
.
(Thu, 19 Jul 2012 00:27:02 GMT)
Full text and
rfc822 format available.
Message #16 received at 11938 <at> debbugs.gnu.org (full text, mbox):
On Wed, Jul 18, 2012 at 12:25 PM, Stefan Monnier
<monnier <at> iro.umontreal.ca> wrote:
> I'm curious, actually. What does Common-Lisp do with something like:
>
> (let ((a 2)) (progv '(a b) '(1 2) a))
>
> does it return 2 (the value of the lexically-scoped var `a') or 1?
SBCL, CLisp and Clozure agree on the result: 2
Juanma
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Thu, 16 Aug 2012 11:24:03 GMT)
Full text and
rfc822 format available.
This bug report was last modified 12 years and 362 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.