From xemacs-m  Wed May 14 13:10:42 1997
Received: from synaptics.synaptics.com (synaptics.synaptics.com [207.92.223.3])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA11834
	for <xemacs-beta@xemacs.org>; Wed, 14 May 1997 13:10:38 -0500 (CDT)
Received: (from mail@localhost) by synaptics.synaptics.com (8.7.5/8.7.3) id LAA06645 for <xemacs-beta@xemacs.org>; Wed, 14 May 1997 11:10:00 -0700 (PDT)
X-Authentication-Warning: synaptics.synaptics.com: mail set sender to <daveg@thymus> using -f
Received: from synaptx.synaptics.com(192.147.44.16) by synaptics.synaptics.com via smap (V1.3)
	id sma006639; Wed May 14 11:09:35 1997
Received: from thymus.synaptics.com by synaptx.synaptics.com (4.1/SMI-4.1)
	id AA27594; Wed, 14 May 97 11:07:17 PDT
Received: by thymus.synaptics.com (4.1/SMI-4.1)
	id AA03049; Wed, 14 May 97 11:05:47 PDT
Message-Id: <9705141805.AA03049@thymus.synaptics.com>
To: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: Byte-compiler warning 
In-Reply-To: Your message of "14 May 97 11:34:33 +0200."
             <rjenbacs7q.fsf@zuse.dina.kvl.dk> 
Reply-To: daveg@synaptics.com
Date: Wed, 14 May 97 11:05:44 -0700
From: Dave Gillespie <daveg@synaptics.com>

Hrvoje Niksic <hniksic@srce.hr> writes:
> 1) modify bytecomp.el to not generate such warnings;
> 
> 2) "fix" bytecomp.el so that it generates the warnings for all symbols
>    but keywords;
> 
> 3) modify cl.el not to emit variable references to keywords.

None of these are very satisfying.


Per Abrahamsen writes:
> Maybe cl.el could be modified to emit code like
> 	(or (boundp ':id) (setq :id ':id))
> instead?  

This won't work.  The problem is not that executing the `setq'
causes a run-time error, but that *compiling* the `setq' causes
a compiler warning.


David Moore writes:
> (defun cl-make-keyword (key) (or (boundp key) (set key key)))

This is pretty good.  The `cl-make-keyword' function should go
in cl.el itself, not cl-macs.el or cl-extra.el.  The only problem
is that you still lose byte-code compatibility until the FSF adds
`cl-make-keyword' to *their* cl.el also.


Here is one more solution:

Leave the warning in the byte compiler generally, but skip the
warning *if* the form that generates the warning explicitly
matches this pattern:

	(setq SYMBOL (quote SYMBOL))


Yet another solution:

Change cl-macs.el to generate (set (quote SYMBOL) (quote SYMBOL))
instead, and make sure the compiler does not (i.e., is too
stupid to) warn about this construct.  David Moore suggested
the even more elaborate form (let ((a (quote SYMBOL))) (set a a)),
but that's a bit more bulky than you want to generate in-line,
as David pointed out.

								-- Dave

