_ From:	CRDGW2::CRDGW2::MRGATE::"SMTP::PREP.AI.MIT.EDU::INFO-GNU-EMACS-REQUEST" 14-JUL-1989 01:32  To:	MRGATE::"ARISIA::EVERHART" Subj:	Bug fix for byte-compile  R Received: by life.ai.mit.edu (4.1/AI-4.10) id AA01612; Thu, 13 Jul 89 07:36:29 EDT1 Return-Path: <think!compass!worley@eddie.mit.edu> f Received: from AENEAS.MIT.EDU by life.ai.mit.edu (4.1/AI-4.10) id AA01566; Thu, 13 Jul 89 07:29:25 EDTc Received: from EDDIE.MIT.EDU by AENEAS.MIT.EDU (5.61/4.7) id AA04945; Thu, 13 Jul 89 07:29:20 -0400  Received: by EDDIE.MIT.EDU with UUCP with smail2.5 with sendmail-5.45/4.7 id <AA01142@EDDIE.MIT.EDU>; Thu, 13 Jul 89 07:29:00 EDT ! Received: by think.com (smail2.5) ) 	id AA05451; 13 Jul 89 07:29:21 EDT (Thu) > Received: from galaxy.compass.com by compass.com (3.2/SMI-3.2)( 	id AA29242; Wed, 12 Jul 89 19:48:55 EDT- Received: by galaxy.compass.com (3.2/SMI-3.2) ( 	id AA10049; Wed, 12 Jul 89 19:47:14 EDT! Date: Wed, 12 Jul 89 19:47:14 EDT 0 From: compass!worley@eddie.mit.edu (Dale Worley)3 Message-Id: <8907122347.AA10049@galaxy.compass.com>   To: info-gnu-emacs@eddie.mit.edu! Subject: Bug fix for byte-compile   E The following code seems to fix the bug in byte-compiling forms whose B function is a lambda expression.  It does so by rewriting the form8 into one that uses funcall (not apply!) as the function:  $ 	((lambda (...) body) a b c ...) => 8 		(funcall '(lambda (...) byte-compiled-body) a b c ...)  B It seems to work in simple cases.  There is probably a better way.  B Don't forget to byte-compile the fix -- it's the inner loop of the0 byte-compile functions, which are none too fast!   Dale --B Dale Worley, Compass, Inc.                      worley@compass.com- The War on Drugs -- Prohibition for the '80s.    (defun byte-compile-form (form) ?   (setq form (macroexpand form byte-compile-macro-environment))    (cond ((eq form 'nil)  	 (byte-compile-constant form))  	((eq form 't) 	 (byte-compile-constant form))  	((symbolp form)0 	 (byte-compile-variable-ref 'byte-varref form)) 	((not (consp form)) 	 (byte-compile-constant form)) $ 	((eq (car-safe (car form)) 'lambda) 	 (byte-compile-form (cons 			     'funcall
 			     (cons 7 			      (list 'quote (byte-compile-lambda (car form)))  			      (cdr form)))))  	((not (symbolp (car form)))/ 	 (signal 'invalid-function (list (car form))))  	(t 1 	 (let ((handler (get (car form) 'byte-compile)))  	   (if handler  	       (funcall handler form)) 	     (byte-compile-normal-call form)))))    (setq byte-compile-maxdepth  	(max byte-compile-maxdepth : 	     (setq byte-compile-depth (1+ byte-compile-depth)))))