[Top][All Lists]

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

Re: bytecomp warning for CL functions

From: Dave Love
Subject: Re: bytecomp warning for CL functions
Date: 01 Jul 2002 19:11:19 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

> Could someone explain to me what this really does ?

It detects all (I hope) use of cl functions in the compiled code to
help me debug it.

> I had installed a hack that tries to notice when you call a function
> that will not be available at runtime (because the library
> was loaded via (eval-when-compile (require 'LIB)) as is done for CL).

The cases of interest are when that isn't done, or when you're in a
session that's already loaded it for some reason (e.g. Debian with
various Emacs packages installed) or when there's an explicit autoload
defined for a cl function, &c.  (Real examples.)

> I notice for example that it warns about code that uses `values' but
> since the CVS has replaced the defvalias with a defsubst for `values',
> a call to `values' gets replaced during byte-compilation so that
> it works just fine even without using CL at runtime.

The warning would be useful regardless, if you're trying to make stuff
run in 21.2.  In principle it would also list things problematic in
Emacs 20, but I don't currently need that.

> What I'm trying to figue out is if there is a way to get the benefits
> of Dave's code without having to hard-code any particular list
> of functions.

Sure.  You'd have to check the indirections of aliases to see if they
contained anything defined in the cl files.  Obviously you could
generalize it to deal with packages other than cl, but I can't think
of any for which that would be useful.

reply via email to

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