From xemacs-m  Wed May 14 13:32:28 1997
Received: from newman.aventail.com (root@newman.aventail.com [199.238.236.1])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id NAA24277
	for <xemacs-beta@xemacs.org>; Wed, 14 May 1997 13:32:27 -0500 (CDT)
Received: from kramer.in.aventail.com.aventail.com (wmperry@[192.168.1.12])
	by newman.aventail.com (8.8.5/8.8.5) with SMTP id LAA00700;
	Wed, 14 May 1997 11:32:27 -0700 (PDT)
To: daveg@synaptics.com
Cc: XEmacs Developers <xemacs-beta@xemacs.org>
Subject: Re: Byte-compiler warning
References: <9705141805.AA03049@thymus.synaptics.com>
Errors-to: wmperry@aventail.com
Reply-to: wmperry@aventail.com
X-Face: O~Rn;(l][/-o1sALg4A@xpE:9-"'IR[%;,,!m7</SYF`{vYQ(&RI1&EiH[FvT;J}@f!4kfz
 x_!Y#=y{Uuj9GvUi=cPuajQ(Z42R[wE@{G,sn$qGr5g/wnb*"*ktI+,CD}1Z'wxrM2ag-r0p5I6\nA
 [WJopW_J.WY;
From: wmperry@aventail.com (William M. Perry)
Date: 14 May 1997 11:32:27 -0700
In-Reply-To: Dave Gillespie's message of Wed, 14 May 97 11:05:44 -0700
Message-ID: <86iv0lsy4k.fsf@kramer.in.aventail.com>
Lines: 56
X-Mailer: Gnus v5.4.52/XEmacs 20.2(beta6)

Dave Gillespie <daveg@synaptics.com> writes:

> 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.

[...]
> 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.  

  This gets rid of the defstruct warnings.  I believe it will fix all
occurences of this bug, since everything eventually uses cl-do-arglist,
right?  The bytecode generated by this appears to work under Emacs 19 as
well.

-Bill P.

*** cl-macs.el	1997/05/14 18:27:34	1.1
--- cl-macs.el	1997/05/14 18:27:49
***************
*** 307,313 ****
  	      (cl-push karg keys)
  	      (if (= (aref (symbol-name karg) 0) ?:)
  		  (progn (set karg karg)
! 			 (cl-push (list 'setq karg (list 'quote karg))
  				  bind-inits)))))))
        (setq keys (nreverse keys))
        (or (and (eq (car args) '&allow-other-keys) (cl-pop args))
--- 307,315 ----
  	      (cl-push karg keys)
  	      (if (= (aref (symbol-name karg) 0) ?:)
  		  (progn (set karg karg)
! 			 (cl-push (list 'set
! 					(list 'quote karg)
! 					(list 'quote karg))
  				  bind-inits)))))))
        (setq keys (nreverse keys))
        (or (and (eq (car args) '&allow-other-keys) (cl-pop args))

