From: Joe Riel <jriel@maplesoft.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Byte-compile constants in a function
Date: Wed, 4 Jul 2012 19:42:26 -0700 [thread overview]
Message-ID: <20120704194226.25246b60@gauss> (raw)
In-Reply-To: <jwvr4srmzf2.fsf-monnier+gnu.emacs.help@gnu.org>
On Wed, 04 Jul 2012 09:26:06 -0400
Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> > (defconst tag-prompt ?>)
> > (defun check (char) (eq char tag-prompt))
>
> You can do
>
> (eval-when-compile
> (defconst tag-prompt ?>))
>
> (defun check (char) (eq char (eval-when-compile tag-prompt)))
>
>
> -- Stefan
Thanks, that seems nicer than using defsubst. Possibly with that
I'll finally understand what eval-when-compile is all about.
--
Joe Riel
next prev parent reply other threads:[~2012-07-05 2:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.3953.1341335828.855.help-gnu-emacs@gnu.org>
2012-07-03 20:26 ` Byte-compile constants in a function José A. Romero L.
2012-07-04 6:07 ` Joe Riel
2012-07-04 13:26 ` Stefan Monnier
2012-07-05 2:42 ` Joe Riel [this message]
2012-07-03 16:57 Joe Riel
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=20120704194226.25246b60@gauss \
--to=jriel@maplesoft.com \
--cc=help-gnu-emacs@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.
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).