From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joe Riel Newsgroups: gmane.emacs.help Subject: Re: Byte-compile constants in a function Date: Tue, 3 Jul 2012 23:07:36 -0700 Organization: Maplesoft Message-ID: <20120703230736.406fb349@gauss> References: <7fe94425-ce97-48e0-8afc-b2faa21b8c87@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1341405076 7279 80.91.229.3 (4 Jul 2012 12:31:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 4 Jul 2012 12:31:16 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 04 14:31:16 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SmOjh-0000wy-AK for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 14:31:13 +0200 Original-Received: from localhost ([::1]:41287 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmOjg-0003Z6-5S for geh-help-gnu-emacs@m.gmane.org; Wed, 04 Jul 2012 08:31:12 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54517) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmIyV-0002rS-WE for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 02:22:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SmIyU-0008WM-FG for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 02:22:07 -0400 Original-Received: from icw8kmai01.maplesoft.com ([199.71.183.105]:57047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SmIyU-0008Ur-Bx for help-gnu-emacs@gnu.org; Wed, 04 Jul 2012 02:22:06 -0400 Original-Received: from gauss (10.10.50.20) by ICW8KMAI01.maplesoft.com (10.10.1.104) with Microsoft SMTP Server (TLS) id 8.3.245.1; Wed, 4 Jul 2012 02:08:28 -0400 In-Reply-To: <7fe94425-ce97-48e0-8afc-b2faa21b8c87@googlegroups.com> X-Mailer: Claws Mail 3.7.9 (GTK+ 2.24.4; x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: Windows 2000 SP2+, XP SP1+ (seldom 98) X-Received-From: 199.71.183.105 X-Mailman-Approved-At: Wed, 04 Jul 2012 08:31:05 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:85649 Archived-At: On Tue, 3 Jul 2012 13:26:13 -0700 (PDT) Jos=C3=A9 A. Romero L. wrote: > W dniu wtorek, 3 lipca 2012 18:57:12 UTC+2 u=C5=BCytkownik Joe Riel napis= a=C5=82: > > Is there a way to define constant/macros so that the value is expanded > > during byte-compilation of a function that uses them? > (...) >=20 > How about defining an inlined function that returns the constant > you need? >=20 > (defsubst tag-prompt () ?>) >=20 > then: >=20 > (defun check (char) (eq char (tag-prompt))) >=20 > a quick look at the byte-compiled code shows that the value > of (tag-prompt) is indeed inlined. Thanks, that does what I want. --=20 Joe Riel