all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dave Love <d.love@dl.ac.uk>
Cc: Martin Stjernholm <mast@lysator.liu.se>,
	 Kenichi Handa <handa@m17n.org>,
	rms@gnu.org,  emacs-devel@gnu.org
Subject: Re: cc-vars.el
Date: 19 Nov 2002 16:59:18 +0000	[thread overview]
Message-ID: <rzqlm3p7axl.fsf@albion.dl.ac.uk> (raw)
In-Reply-To: buod6p2xrol.fsf@mcspd15.ucom.lsi.nec.co.jp

Miles Bader <miles@lsi.nec.co.jp> writes:

> _That_ sort of change is pretty easy, and has the advantage of working
> even with old compilers that don't special case it (they'll just emit a
> warning like before, but the generated code will be the same).

Exactly.  This was it.  I think it was the only diff needed, but I'm
not sure it didn't depend on another change.

As far as I remember, someone didn't like it because it wasn't
general, i.e. it doesn't work with all conditionals.  I don't think
that matters if it's documented.

*** bytecomp.el	23 Jul 2001 16:02:49 -0000	2.84
--- bytecomp.el	19 Nov 2002 11:29:15 -0000
*************** If FORM is a lambda or a macro, byte-com
*** 3213,3231 ****
  
  (defun byte-compile-if (form)
    (byte-compile-form (car (cdr form)))
!   (if (null (nthcdr 3 form))
!       ;; No else-forms
!       (let ((donetag (byte-compile-make-tag)))
! 	(byte-compile-goto-if nil for-effect donetag)
! 	(byte-compile-form (nth 2 form) for-effect)
! 	(byte-compile-out-tag donetag))
!     (let ((donetag (byte-compile-make-tag)) (elsetag (byte-compile-make-tag)))
!       (byte-compile-goto 'byte-goto-if-nil elsetag)
!       (byte-compile-form (nth 2 form) for-effect)
!       (byte-compile-goto 'byte-goto donetag)
!       (byte-compile-out-tag elsetag)
!       (byte-compile-body (cdr (cdr (cdr form))) for-effect)
!       (byte-compile-out-tag donetag)))
    (setq for-effect nil))
  
  (defun byte-compile-cond (clauses)
--- 3213,3258 ----
  
  (defun byte-compile-if (form)
    (byte-compile-form (car (cdr form)))
!   ;; Check whether we have `(if (fboundp ...' or `(if (boundp ...'
!   (let* ((clause (nth 1 form))
! 	 (fbound (if (eq 'fboundp (car-safe clause))
! 		     (and (eq 'quote (car-safe (nth 1 clause)))
! 			  (nth 1 (nth 1 clause))))) ; the relevant symbol
! 	 (bound (if (eq 'boundp (car-safe clause))
! 		    (and (eq 'quote (car-safe (nth 1 clause)))
! 			 (nth 1 (nth 1 clause)))))) ; the relevant symbol
!     (if (null (nthcdr 3 form))
! 	;; No else-forms
! 	(let ((donetag (byte-compile-make-tag)))
! 	  (byte-compile-goto-if nil for-effect donetag)
! 	  (cond (bound (let ((byte-compile-bound-variables
! 			      (cons bound
! 				    byte-compile-bound-variables)))
! 			 (byte-compile-form (nth 2 form) for-effect)))
! 		(fbound (byte-compile-form (nth 2 form) for-effect)
! 			(setq byte-compile-unresolved-functions
! 			      (delq (assq fbound
! 					  byte-compile-unresolved-functions)
! 				    byte-compile-unresolved-functions)))
! 		(t (byte-compile-form (nth 2 form) for-effect)))
! 	  (byte-compile-out-tag donetag))
!       (let ((donetag (byte-compile-make-tag))
! 	    (elsetag (byte-compile-make-tag)))
! 	(byte-compile-goto 'byte-goto-if-nil elsetag)
! 	(cond (bound (let ((byte-compile-bound-variables
! 			    (cons bound
! 				  byte-compile-bound-variables)))
! 		       (byte-compile-form (nth 2 form) for-effect)))
! 	      (fbound (byte-compile-form (nth 2 form) for-effect)
! 		      (setq byte-compile-unresolved-functions
! 			    (delq (assq fbound
! 					byte-compile-unresolved-functions)
! 				  byte-compile-unresolved-functions)))
! 	      (t (byte-compile-form (nth 2 form) for-effect)))
! 	(byte-compile-goto 'byte-goto donetag)
! 	(byte-compile-out-tag elsetag)
! 	(byte-compile-body (cdr (cdr (cdr form))) for-effect)
! 	(byte-compile-out-tag donetag))))
    (setq for-effect nil))
  
  (defun byte-compile-cond (clauses)

  parent reply	other threads:[~2002-11-19 16:59 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E18CrrF-0005AT-00@fencepost.gnu.org>
     [not found] ` <rzqwunberel.fsf@albion.dl.ac.uk>
2002-11-18  0:57   ` cc-vars.el Kenichi Handa
2002-11-18 19:09     ` cc-vars.el Richard Stallman
2002-11-18 19:51     ` cc-vars.el Dave Love
2002-11-18 22:15       ` cc-vars.el Martin Stjernholm
2002-11-19  1:40         ` cc-vars.el Miles Bader
2002-11-19 15:45           ` cc-vars.el Martin Stjernholm
2002-11-19 16:57             ` cc-vars.el Miles Bader
2002-11-19 21:58               ` cc-vars.el Martin Stjernholm
2002-11-20  2:22                 ` cc-vars.el Miles Bader
2002-11-20 13:58                   ` cc-vars.el Stefan Monnier
2002-11-20 15:43                     ` cc-vars.el Kim F. Storm
2002-11-20 15:01                       ` cc-vars.el Stefan Monnier
2002-11-20 16:37                         ` cc-vars.el Kim F. Storm
2002-11-24 19:32                           ` cc-vars.el Dave Love
2002-11-24 19:30                         ` cc-vars.el Dave Love
2002-11-20 21:29                     ` cc-vars.el Miles Bader
2002-11-20 21:44                       ` cc-vars.el Stefan Monnier
2002-11-22  1:51                       ` cc-vars.el Martin Stjernholm
2002-11-21 17:12                     ` cc-vars.el Richard Stallman
2002-11-21 18:55                       ` cc-vars.el Stefan Monnier
2002-11-22  2:00                         ` cc-vars.el Martin Stjernholm
2002-11-20 16:40                 ` cc-vars.el Dave Love
2002-11-20 16:35             ` cc-vars.el Dave Love
2002-11-19 16:59           ` Dave Love [this message]
2002-11-20 21:14             ` cc-vars.el Richard Stallman
2002-11-24 19:33               ` cc-vars.el Dave Love
2002-11-20 21:41             ` cc-vars.el Miles Bader
2002-11-24 19:36               ` cc-vars.el Dave Love
2002-11-19  7:49         ` cc-vars.el Kai Großjohann
2002-11-19 16:55         ` cc-vars.el Dave Love
2002-11-19 20:35           ` cc-vars.el Martin Stjernholm
2002-11-20  9:46             ` cc-vars.el Kai Großjohann
2002-11-21 17:12               ` cc-vars.el Richard Stallman
2002-11-20 16:38             ` cc-vars.el Dave Love
2002-11-18 22:17       ` cc-vars.el Stefan Monnier
2002-11-19 17:01         ` cc-vars.el Dave Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=rzqlm3p7axl.fsf@albion.dl.ac.uk \
    --to=d.love@dl.ac.uk \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=mast@lysator.liu.se \
    --cc=rms@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.