all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Joe Riel <jriel@maplesoft.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Byte-compile constants in a function
Date: Tue, 3 Jul 2012 23:07:36 -0700	[thread overview]
Message-ID: <20120703230736.406fb349@gauss> (raw)
In-Reply-To: <7fe94425-ce97-48e0-8afc-b2faa21b8c87@googlegroups.com>

On Tue, 3 Jul 2012 13:26:13 -0700 (PDT)
José A. Romero L. <escherdragon@gmail.com> wrote:

> W dniu wtorek, 3 lipca 2012 18:57:12 UTC+2 użytkownik Joe Riel napisał:
> > Is there a way to define constant/macros so that the value is expanded
> > during byte-compilation of a function that uses them?
> (...)
> 
> How about defining an inlined function that returns the constant
> you need?
> 
>     (defsubst tag-prompt () ?>)
> 
> then:
> 
>     (defun check (char) (eq char (tag-prompt)))
> 
> a quick look at the byte-compiled code shows that the value
> of (tag-prompt) is indeed inlined.

Thanks, that does what I want.

-- 
Joe Riel




  reply	other threads:[~2012-07-04  6:07 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 [this message]
2012-07-04 13:26 ` Stefan Monnier
2012-07-05  2:42   ` Joe Riel
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

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

  git send-email \
    --in-reply-to=20120703230736.406fb349@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.
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.