Subject: Re: bug#6750: Byte compiler: spurious message "cl used at runtime"

From: Stefan Monnier <[email-masked]>
Date: Thu, 29 Jul 2010 01:01:46 +0200

> In this macro declaration:

>     (defmacro c-declare-lang-variables ()
>       `(progn
>          ,@(mapcan (lambda (init)
>                      `(,(if (elt init 2)
>                             `(defvar ,(car init) nil ,(elt init 2))
>                           `(defvar ,(car init) nil))
>                        (make-variable-buffer-local ',(car init))))
>                    (cdr c-lang-variable-inits))))

> , (from cc-engine.el), the byte-compiler gives this warning:

>     "Function `mapcan' from cl package called at runtime".

> It is clear that the mapcan, being within a ,@ construct, does its work
> at macro-expansion time, i.e. compile time.

> Thus the warning message is wrong.  This is a bug.

This macro will be in the .elc.  This means it can be called "at run
time" (e.g. if you do M-: (c-declare-lang-variables ...) RET).

        Stefan