unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: michael_heerdegen@web.de
Cc: 11938@debbugs.gnu.org
Subject: bug#11938: 24.1.50; Some not so useful CL related byte compiler warnings
Date: Wed, 18 Jul 2012 06:25:16 -0400	[thread overview]
Message-ID: <jwvehoa8t6q.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <86liinh77s.fsf@web.de> (Michael Heerdegen's message of "Fri, 13 Jul 2012 20:00:23 +0200")

> 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







  parent reply	other threads:[~2012-07-18 10:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 18:00 bug#11938: 24.1.50; Some not so useful CL related byte compiler warnings Michael Heerdegen
2012-07-13 18:18 ` Andreas Schwab
2012-07-18 10:25 ` Stefan Monnier [this message]
2012-07-19  0:19   ` Juanma Barranquero

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvehoa8t6q.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=11938@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).