unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Vinicius Jose Latorre <viniciusjl@ig.com.br>
Cc: emacs-devel@gnu.org
Subject: Re: printing.el again
Date: Mon, 15 Nov 2004 22:55:23 -0200	[thread overview]
Message-ID: <41994FFB.2060308@ig.com.br> (raw)
In-Reply-To: <jwvactig7xi.fsf-monnier+emacs@gnu.org>

 > > Ok, but a very long time ago there was a recommendation to do not 
use cl
 > > package when writing code in Emacs Lisp.
 > > Is that recommendation no more valid?
 >
 > CL functions should indeed not be used by packages distributed with 
Emacs.
 > OTOH, CL macros (such as `push', `flet', ...) can be used just fine (just
 > don't forget to put a (eval-when-compile (require 'cl)) at the top of 
your
 > file).

Ok.


 > > > BTW, if you use (featurep 'xemacs) for the test, Emacs-21 will 
optimize
 > > > the test away (since the resulting elc file can't be run on XEmacs
 > > > anyway).  Here it doesn't really matter, but it is sometimes very 
handy
 > > > since it ends up getting rid of spurious warnings about
 > > > XEmacs-specific code.
 > >
 > > Well, so:
 > >
 > > A) (cond ((eq ps-print-emacs-type 'xemacs) ...)
 > >          (t ...))
 > >
 > > B) (cond ((featurep 'xemacs) ...)
 > >          (t ...))
 > >
 > > Are you saying that A and B above are treated differently by the
 > > byte-compiler??
 >
 > Yes.
 >
 > The byte-compiler will not optimize away the `eq' test because it 
considers
 > that the user might change ps-print-emacs-type at any time.  OTOH the
 > byte-compiler knows that since the code it generates doesn't work under
 > XEmacs, (featurep 'xemacs) will always return nil.

So, I'll modify to use (featurep 'xemacs).

Does the byte-compiler do constant folding optimization or it is an ad hoc
optimization?

Maybe this should be documented in Emacs Lisp Reference or in other suitable
info, probably Byte Compiler Users Guide.  Also other byte-compiler
optimizations should be documented.


Vinicius

  reply	other threads:[~2004-11-16  0:55 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-14  5:59 printing.el again Stefan
2004-11-14 15:29 ` Vinicius Jose Latorre
2004-11-14 19:20   ` Stefan Monnier
2004-11-15 20:03     ` Vinicius Jose Latorre
2004-11-15 20:47       ` Stefan Monnier
2004-11-16  0:55         ` Vinicius Jose Latorre [this message]
2004-11-16  1:29           ` Stefan
2004-11-16  1:36             ` Luc Teirlinck
2004-11-16 14:47             ` Ralf Angeli
2004-11-16 16:51               ` Stefan Monnier
2004-11-18  1:53             ` Vinicius Jose Latorre
2004-11-18 16:30               ` Stefan Monnier
2004-11-18 22:44                 ` Vinicius Jose Latorre
2004-11-18 23:31                   ` Stefan Monnier
2004-11-19 20:04                   ` Richard Stallman
2004-11-17  5:03       ` Richard Stallman

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=41994FFB.2060308@ig.com.br \
    --to=viniciusjl@ig.com.br \
    --cc=emacs-devel@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).